If your UIViewController is a child in some root view, IB does not add it as a child controller to the default root controller. The easiest way to solve this problem is to change the root controller:
- (void)viewDidLoad { [super viewDidLoad]; [self addChildViewController:(UIViewController*) self.yourChildController]; }
That should do the trick. Now your child controller will receive both:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration;
and
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation;
messages.
Igor Touzov
source share