Xcode 7 beta 3 Storyboard bug

混江龙づ霸主 提交于 2019-12-12 03:18:41

问题


I am attempting to make an app without using StoryBoard. I am instantiating my root view controller from the AppDelegate When I run my app I get the following SIGABRT.

 *** Assertion failure in -[UIStoryboard initWithBundle:storyboardFileName:identifierToNibNameMap:identifierToExternalStoryboardReferenceMap:designatedEntryPointIdentifier:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3486.4/UIStoryboard.m:63
2015-07-26 18:42:54.204 NarwhalFeed[3783:2840317] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: nibNameMap != nil'
*** First throw call stack:

When I open my main.storyboard file I don't have any UIViewController marked as "Is Initial View Controller" found in the Attributed inspector. But when I choose the view controller as initial view controller the app runs fine. Is this is a bug in xcode 7 beta?


回答1:


You need to remove the reference to your storyboard file from the "Main Interface" section of your target's settings in Xcode. If the storyboard is still referenced in that section then the start-up code will try an instantiate your initial scene even though you are going to replace it with your own view.

If your storyboard doesn't contain an initial scene then you get an exception. This behaviour is not new to iOS 9.



来源:https://stackoverflow.com/questions/31642741/xcode-7-beta-3-storyboard-bug

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