大家我工作的一個iOS Static Library
。當我在示例應用程序中使用這個靜態庫和運行它,它下面的異常崩潰......應用程序崩潰與NSInternalInconsistencyException」,原因是:‘不能在包中加載NIB’
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/name/Library/Developer/CoreSimulator/Devices/D982246E-72D6-482F-8E1C-AE3D1BF37607/data/Containers/Bundle/Application/016193F2-36A3-492D-8E7B-CE560FACCF6D/TestApp.app> (loaded)' with name 'OptionsViewController''
*** First throw call stack:
(
0 CoreFoundation 0x0000000107385c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010701ebb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000107385b9d +[NSException raise:format:] + 205
3 UIKit 0x0000000107d30171 -[UINib instantiateWithOwner:options:] + 552
4 UIKit 0x0000000107b88718 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
5 UIKit 0x0000000107b88d08 -[UIViewController loadView] + 109
6 UIKit 0x0000000107b88f79 -[UIViewController loadViewIfRequired] + 75
7 UIKit 0x0000000107b8940e -[UIViewController view] + 27
8 UIKit 0x0000000107bae297 -[UINavigationController _startCustomTransition:] + 633
9 UIKit 0x0000000107bba3bf -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
10 UIKit 0x0000000107bbaf0e -[UINavigationController __viewWillLayoutSubviews] + 43
11 UIKit 0x0000000107d05715 -[UILayoutContainerView layoutSubviews] + 202
12 UIKit 0x0000000107ad8a2b -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
13 QuartzCore 0x000000010bcbeec2 -[CALayer layoutSublayers] + 146
14 QuartzCore 0x000000010bcb36d6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
15 QuartzCore 0x000000010bcb3546 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
16 QuartzCore 0x000000010bc1f886 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
17 QuartzCore 0x000000010bc20a3a _ZN2CA11Transaction6commitEv + 462
18 QuartzCore 0x000000010bc210eb _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89
19 CoreFoundation 0x00000001072b8ca7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
20 CoreFoundation 0x00000001072b8c00 __CFRunLoopDoObservers + 368
21 CoreFoundation 0x00000001072aea33 __CFRunLoopRun + 1123
22 CoreFoundation 0x00000001072ae366 CFRunLoopRunSpecific + 470
23 GraphicsServices 0x000000010b7e7a3e GSEventRunModal + 161
24 UIKit 0x0000000107a58900 UIApplicationMain + 1282
25 TestApp 0x0000000106a54bcf main + 111
26 libdyld.dylib 0x0000000109b7f145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
我知道,一般這個錯誤意味着OptionsViewController
廈門國際銀行文件不被列入該庫/項目,但猜測什麼? OptionsViewController's
.m
文件存在於圖書館的Build Phases
複製文件目前有compile Sources
和.h
和.xib
文件。
該庫的工作文件,Xcode 6.1
。我安裝的時間是Xcode 6.3
。此崩潰進來的畫面,現在它不是在Xcode 6.1
即使工作現在,我無言以對,爲什麼我的示例應用程序保持崩潰。整整一天,我一直在努力解決這個問題,但沒有任何運氣。
任何指導,線索,什麼將高度讚賞。
UPDATE
應用程序無法找到資源,文件,從靜態庫什麼。 我必須包括所有.h
,.xibs
和resources
文件構建示例應用程序的臉,使其工作,這是不這樣做,我覺得正確的方式。
您是否打開了.app文件並雙擊檢查.xib文件真的在那裏? – picciano
您使用哪種方法初始化類? –
@DanieleCandotti'[[OptionsViewController alloc] initWithNibName:@「OptionsViewController」bundle:nil];'是我初始化這個對象的方式。 – Suryakant