完整的错误信息如下:终止应用程序,原因是未捕获的异常 'NSUnknownKeyException',原因:'[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key。
所以我已经尝试了其他人对类似问题的解决方法。我已经尝试删除项目中对landscapeView的所有提及,包括ViewController_iPhone.xib中File's Owner中的Connections,然后我从头开始,在父类ViewController中添加了outlets(因为我也想在iPad上使用landscapeView和portraitView),然后我分别在ViewController_iPhone.xib和ViewController_iPad.xib中设置与各自的名为Landscape的UIView的连接,但仍然出现错误。
我刚开始学习应用程序开发,所以我正在尝试制作一个支持iPhone和iPad上所有方向的应用程序模板。谢谢您的帮助。
编辑:这里是我的AppDelegate.h、.m和main.m的链接:我遇到了“ Applications are expected to have a root view controller at the end of application launch error”错误
编辑2:所以我也尝试将landscapeView设置为ViewController的属性,并在ViewController.m中创建setter方法,但仍然存在相同的问题。