views:

43

answers:

1

I've spent the last hour or so trying to work out why not all my UIViewControllers are receiving orientation change notifications.

I've got a subclassed UIViewController attached to the window, that internally creates a few other UIViewControllers to manage smaller portions of the screen which are re-used elsewhere in the application I'm building.

The problem is, only the UIViewController attached to the window is receiving the orientation change notifications. The other UIViewControllers aren't firing their - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration methods.

I'm assuming it's expected behaviour, and I can't seem to find anything mentioning it in the docs.

Is there a way to make sure all active UIViewControllers are getting orientation changes? Or does the parent view controller have to tell it's children when changes are occurring?

Cheers.

A: 

Are all your view controllers returning YES to shouldAutorotateToInterfaceOrientation: ? If so, I suggest to pass the interface orientation messages from the parent to the children viewControllers, as you suggested.

I have been doing so before and had no problems with that approach so far.

tonklon
Indeed, that's the route I ended up taking.Although I develop my interfaces without Interface Builder, but I just pass the notification on in the `UIViewControllers` `- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration` method to the child view controllers.Turns our only the UIViewController attached to the UIWindow receives the orientation change notifications.
d2kagw