故事板崩溃 - 符合编码的关键sceneViewController

时间:2012-06-15 09:26:55

标签: ios5 uiviewcontroller storyboard key

我在iOS 5中使用Storyboard进行间歇性崩溃。当我尝试使用Storyboard中的视图控制器实例化一个新对象时,我经常会遇到一个SIGABRT。这似乎是一个非常普遍的错误,但我找不到其他人看到这个。谢谢你的帮助!

SectionLandscapeViewController *sectionViewController = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"SectionLandscapeViewController"];

崩溃......

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIProxyObject 0xa0fba20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key sceneViewController.'

4 个答案:

答案 0 :(得分:1)

打开此控制器的.xib文件,右键单击“文件所有者”并检查是否已连接任何错误的属性或插座。如果是错误的,你会在插座的右侧找到一个黄色小图标。只需删除它并尝试。

答案 1 :(得分:1)

我能够通过在iPhone模拟器中执行“重置内容和设置”来解决此问题。

答案 2 :(得分:0)

在模拟器中运行:

尝试Simulator -> Reset Content and Settings

在设备上

尝试删除并重新安装应用

答案 3 :(得分:0)

尝试使用与真实的UIViewController类名称不同的情节提要ID。