iOS 6:改变了什么使得View Controller Hierarchy中断了?

Joh*_*oan 4 iphone objective-c uiviewcontroller uinavigationcontroller ios6

以下是我的AppDelegate:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

customViewController = [[CustomViewController alloc] initWithNibName:@"CustomViewController" bundle:nil];

self.navigationController = [[UINavigationController alloc] initWithRootViewController:customViewController];

[self.navigationController setNavigationBarHidden:YES];

self.window.rootViewController = self.navigationController;

[self.window makeKeyAndVisible];
Run Code Online (Sandbox Code Playgroud)

在实际的XIB中,视图与"文件所有者"相关联,这是我唯一的关联.

XIB层次结构:

Navigation Controller
    - View Controller - Root View Controller
        -View (Associated with File's Owner)
Run Code Online (Sandbox Code Playgroud)

对不起,如果我不明白这一点,它在以前推出的应用程序上工作正常,但我明白这并不意味着它是正确的.

编辑:对不起,这是我得到的错误:

*由于未捕获的异常'UIViewControllerHierarchyInconsistency'终止应用程序,原因:'视图一次最多只能与一个视图控制器关联!查看<UIView:0xa192d00; frame =(0 20; 320 460); autoresize = W + H; layer = <CALayer:0xa192d60 >>与<UIViewController:0xa195c70>相关联.在将此视图与<CustomViewController:0xa1802a0>关联之前清除此关联.

Jon*_*han 18

确保视图的界面在其层次结构中没有额外的视图控制器.请参阅下面的屏幕截图

之前:
之前

后:
后