Storyboard crash - coding-compliant key sceneViewController

点点圈 提交于 2020-01-01 08:25:36

问题


I'm getting an intermittent crash using Storyboards in iOS 5. Every so often, I get a SIGABRT when I try to instantiate a new object with a view controller from my Storyboard. It seems like a very generic error, but I can't find anyone else that's seen this. Thanks for your help!

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

And the crash...

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

回答1:


Open your .xib file for this controller and right click on "File Owner" and check if you have connected any wrong property or outlets. You will find a small yellow icon on the right side of outlet if it is a wrong one. Just remove that and try.




回答2:


I was able to fix this by doing a "Reset Content and Settings" in the IPhone Simulator.




回答3:


Running it in simulator:

Try Simulator -> Reset Content and Settings

On Device

Try deleting and reinstalling the app




回答4:


Try to use storyboard ID that different from real UIViewController class name.



来源:https://stackoverflow.com/questions/11047991/storyboard-crash-coding-compliant-key-sceneviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!