我正在尝试学习这本书,但所有示例都没有storyBoard,当我尝试构建应用程序时,我发现了这个错误:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application windows are expected to have a root view controller at the end of application launch'
我试图用这个来修复它:
ViewController *myView = [[ViewController alloc] init];
[self.window addSubview:myView];
self.window.rootViewController = myView;
但后来我收到另一个错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[HypnoView _preferredInterfaceOrientationGivenCurrentOrientation:]: unrecognized selector sent to instance 0x78f68730'
有人可以向我解释为什么会发生在我身上吗?