*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Could not load NIB in bundle:
'NSBundle </Users/xxxx/Library/Developer/CoreSimulator/Devices/726F2DC0-0653-4335- 93DD-40AFB9A00CB9/
data/Containers/Bundle/Application/3AD9B7CD-BB77-4676-B72D-D6504468A389/xxxx.app> (loaded)'
with name '1KQ-aR-y8O-view-UPI-Ak-bBq'
and directory 'Main.storyboardc''
*** First throw call stack:
(
0 CoreFoundation 0x000000010a90ee65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109b12deb objc_exception_throw + 48
2 CoreFoundation 0x000000010a90ed9d +[NSException raise:format:] + 205
3 UIKit 0x0000000107dfa3cf -[UINib instantiateWithOwner:options:] + 499
4 UIKit 0x0000000107bd3eea -[UIViewController _loadViewFromNibNamed:bundle:] + 381
5 UIKit 0x0000000107bd4816 -[UIViewController loadView] + 178
6 UIKit 0x0000000107bd4b74 -[UIViewController loadViewIfRequired] + 138
7 UIKit 0x0000000107bdaf4f -[UIViewController __viewWillAppear:] + 120
8 UIKit 0x0000000107c0ae44 -[UINavigationController _startCustomTransition:] + 1203
9 UIKit 0x0000000107c1b23f -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
10 UIKit 0x0000000107c1c3af -[UINavigationController __viewWillLayoutSubviews] + 57
11 UIKit 0x0000000107dc2ff7 -[UILayoutContainerView layoutSubviews] + 248
12 UIKit 0x0000000107af54a3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
13 QuartzCore 0x000000010c24f59a -[CALayer layoutSublayers] + 146
14 QuartzCore 0x000000010c243e70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
15 QuartzCore 0x000000010c243cee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
16 QuartzCore 0x000000010c238475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
17 QuartzCore 0x000000010c265c0a _ZN2CA11Transaction6commitEv + 486
18 QuartzCore 0x000000010c26637c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
19 CoreFoundation 0x000000010a83a367 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
20 CoreFoundation 0x000000010a83a2d7 __CFRunLoopDoObservers + 391
21 CoreFoundation 0x000000010a82ff2b __CFRunLoopRun + 1147
22 CoreFoundation 0x000000010a82f828 CFRunLoopRunSpecific + 488
23 GraphicsServices 0x000000010bd04ad2 GSEventRunModal + 161
24 UIKit 0x0000000107a3e610 UIApplicationMain + 171
25 baajna 0x000000010785e61f main + 111
26 libdyld.dylib 0x000000010e92e92d start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
我没有得到堆栈溢出的预期答案。别人问我尝试了所有他们说的话。但是我无法弄清楚我的问题。请伙计们帮我从盒子里出来。提前致谢
答案 0 :(得分:0)
If you are loading view from storyboard then you should user storyboardobject.instantiateViewControllerWithIdentifier("StoryboardIdentifier"). as per my knowledge nib should work only on separate XIB
答案 1 :(得分:0)
如果加载Nib UIView。请按照以下步骤操作。
打开XCode目标->转到“构建阶段”选项卡->单击“复制包资源”部分->单击添加按钮->添加丢失的Nib文件