self.rootViewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
[self.window addSubview:self.rootViewController.view]; //App will not crash without this line
self.navigationController = [[UINavigationController alloc] initWithRootViewController: self.rootViewController];
[self.window addSubview:self.navigationController.view];
シミュレーターで実行するとクラッシュします。なぜですか?
エラーメッセージ:
Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency',
reason: 'adding a root view controller <RootViewController: 0x6871620> as a child of
view controller:<UINavigationController: 0x6a86dc0>'
まだわからない