I think this is a mistake. The addChildViewController call seems to start without any warnings or errors.
I wrote the following viewDidLoad:
- (void)viewDidLoad { [super viewDidLoad]; MyChildView *aChildViewController = [[MyChildView alloc] initWithNibName:@"MyChildView" bundle:nil]; // Do any additional setup after loading the view, typically from a nib. SEL mySelector = @selector(addChildViewController:); if([UIViewController instancesRespondToSelector:mySelector] == YES) { NSLog(@"YES addChildViewController:"); [self addChildViewController:aChildViewController]; } else { NSLog(@"NO addChildViewController:"); } if([UIViewController instancesRespondToSelector:@selector(automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers)] == YES) { NSLog(@"YES automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers"); } else { NSLog(@"NO automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers"); } }
In iOS 4.3 Simulator, I see the following output. Both posts are limited to iOS 5.0 and above. It seems that addChildViewController is not responding correctly to the 4.3 simulator. I do not have a 4.3 device for testing on the device itself.
2011-11-18 09:55:12.161 testViewFunctionality[873:b303] YES addChildViewController: 2011-11-18 09:55:12.162 testViewFunctionality[873:b303] NO automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers
In the iOS 5.0 simulator, both will answer that this is the correct behavior.
2011-11-18 09:59:31.250 testViewFunctionality[932:f803] YES addChildViewController: 2011-11-18 09:59:31.252 testViewFunctionality[932:f803] YES automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers
I am using Xcode 4.2 on Lion. When I look at UIViewController.h on the 4.3 Simulator platform, addChildViewController is not mentioned : or automatically ForwardAppearanceAndRotationMethodsToChildViewControllers, but the only SDK included is 5.0.

I believe that if you want to be careful, you can test the current version of iOS on a running device. See How to check iOS version?
Joel
source share