Could not load NIB in bundle NSBund xcode 6.4

iOS 码拜 9年前 (2015-09-29) 1121次浏览
我按《精通IOS开发》第六版学习,Xcode为6.4,学到第7章,创建Pickers应用程序时,运行程序时,在显示完启动界面后,提示以下错误

Pickers[1645:44268] *** Terminating app due to uncaught exception “”NSInternalInconsistencyException””, reason: “”Could not load NIB in bundle: “”NSBundle </Users/huensiumui/Library/Developer/CoreSimulator/Devices/A54BD0EC-87E7-4607-818D-6FE075AADD28/data/Containers/Bundle/Application/813D9907-C4F1-4751-84B6-75650399935E/Pickers.app> (loaded)”” with name “”Main””””

*** First throw call stack:

(

0   CoreFoundation                      0x02095746 __exceptionPreprocess + 182

1   libobjc.A.dylib                     0x0057fa97 objc_exception_throw + 44

2   CoreFoundation                      0x0209566d +[NSException raise:format:] + 141

3   UIKit                               0x00b07ddf -[UINib instantiateWithOwner:options:] + 1003

4   UIKit                               0x00b09f82 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 180

5   UIKit                               0x007bd61b -[UIApplication _loadMainNibFileNamed:bundle:] + 58

6   UIKit                               0x007bd934 -[UIApplication _loadMainInterfaceFile] + 245

7   UIKit                               0x007bc2a4 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1337

8   UIKit                               0x007d58ee __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 59

9   UIKit                               0x007baffa -[UIApplication workspaceDidEndTransaction:] + 155

10  FrontBoardServices                  0x0324ac9e __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71

11  FrontBoardServices                  0x0324a72f __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54

12  FrontBoardServices                  0x0325cd7c __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 30

13  CoreFoundation                      0x01fb7050 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16

14  CoreFoundation                      0x01fac963 __CFRunLoopDoBlocks + 195

15  CoreFoundation                      0x01fac0eb __CFRunLoopRun + 971

16  CoreFoundation                      0x01faba5b CFRunLoopRunSpecific + 443

17  CoreFoundation                      0x01fab88b CFRunLoopRunInMode + 123

18  UIKit                               0x007ba9b2 -[UIApplication _run] + 571

19  UIKit                               0x007be0b6 UIApplicationMain + 1526

20  Pickers                             0x0009bd2a main + 138

21  libdyld.dylib                       0x02c74ac9 start + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb)

方案推荐指数:4
提示的很明显了,找不到名字叫”Main”的xib文件
方案推荐指数:4
我没看过那本书,具体的不是很清楚

storyboard和xib文件不一样

你看他的提示,是说”Could not load NIB in bundle:”

nib和xib基本上可以理解为同一个东西

方案推荐指数:8
估计是你写了读取xib文件,可是你没有这个xib文件。
方案推荐指数:8
empty application工程在Xcode6.4中就是empty这个项。也可以建立一个controller类,建立文件的时候选上同时建立xib。就可以建立一个带有xib的工程了。至于你说的上面的错误,是因为系统默认的是执行你的stroryboard。所以找不到xib。你需要删了stroyboard,在运行试试应该就可以了

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Could not load NIB in bundle NSBund xcode 6.4
喜欢 (0)
[1034331897@qq.com]
分享 (0)