"didRotateFromInterfaceOrientation:" not called

Nitesh picture Nitesh · Oct 11, 2011 · Viewed 8.4k times · Source

hi i am traying to add subview a controller's view in a small view of the main view but the didRotateFromInterfaceOrientation:. of the child controller isnt called so i canot make any changes for the change in the orientation

Answer

Nick picture Nick · Jan 26, 2013

didRotateFromInterfaceOrientation will be called (in childViewController) only if you add childViewController to parentViewController like this:

[parentViewController addChildViewController:childViewController];

Note that, you still can switch that behavior on/off with a property:

self.automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers

It is set to YES by default, so in your case you don't need to touch it. Deprecated after iOS 6.0 Cheers