This Apple Developer Guide talks about the didRotateFromInterfaceOrientation method:
Subclasses can override this method to perform additional actions immediately after rotation.
...
Your implementation of this method should call super at some point during its execution.
My best guess is that some drawing operations in the view controller do not occur because you are not calling the superclass method from your implementation. Try fixing this as follows:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { [super didRotateFromInterfaceOrientation:fromInterfaceOrientation]; NSLog(@"Did rotate"); [self layoutBanner]; }
UPDATE: In iOS 8, this method is deprecated and is no longer called when the device is rotated. Instead, you need to use the new method:
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; NSLog(@"Szie changed"); [self layoutBanner]; }
source share