I have a tabbed app with a a UISplitView in one of the tabs.
I'm using UITabBarController+iAds and have an issue which the dev has so far not been able to solve.
Unfortunately, this is what my UI looks like on rotation of the iPad:
The category is called from within AppDelegate and the following code is used to refresh the ad when the device is rotated:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
NSLog(@"Did rotate");
[self layoutBanner];
}
As I understand it, this is preventing the MasterViewController from working correctly but I don't fully understand the principle behind the cascading of method calls to understand how to fix this issue.
Here's what the Apple Developer Guide says about the didRotateFromInterfaceOrientation method:
Subclasses may override this method to perform additional actions immediately after the rotation.
...
Your implementation of this method must call super at some point during its execution.
My best guess is that certain drawing operations in the view controller doesn't happen because you're not calling the superclass method from your implementation. Try to fix it like this:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
NSLog(@"Did rotate");
[self layoutBanner];
}
UPDATE: On iOS 8 this method is deprecated and no longer called when the device is rotated. Instead you need to use a new method:
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
NSLog(@"Szie changed");
[self layoutBanner];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With