I have a view controller with a content view, where I am trying to assign a child view controller to that content view. My code works fine for iOS 6.0, but throws sigabrt for 5.0/5.1. Here’s the relevant code:
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
ContentWebViewController *initialContentVC = [[ContentWebViewController alloc] init];
[self addChildViewController:initialContentVC];
[initialContentVC.view setFrame:self.view.bounds]; // Throws SIGABRT here
[self.containerView addSubview:initialContentVC.view];
[initialContentVC didMoveToParentViewController:self];
self.currentContentVC = initialContentVC;
}
What’s going on here???
Xcode automatically checked “Use AutoLayout” in my nib file in IB. That’s why crashing on iOS earlier than 6.0. Unchecking it did the trick. This got me a few weeks ago too, how annoying!