我的应用程序有问题。它可以在我的iPhone 3GS上完美运行,但是现在我尝试在iPhone 4上对其进行测试,当启动画面可见时,它崩溃了。
这是日志:
2011-07-06 16:01:05.611 Apptest [294:607] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/0C371068-7E74-4C54-997C-80E3B0929411/Apptest.app> (loaded)' with name 'MainWindow''
*** Call stack at first throw:
(
0 CoreFoundation 0x311ec64f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x3494dc5d objc_exception_throw + 24
2 CoreFoundation 0x311ec491 +[NSException raise:format:arguments:] + 68
3 CoreFoundation 0x311ec4cb +[NSException raise:format:] + 34
4 UIKit 0x368c9a53 -[UINib instantiateWithOwner:options:] + 1110
5 UIKit 0x368cae09 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
6 UIKit 0x366f54cd -[UIApplication _loadMainNibFile] + 96
7 UIKit 0x366efb09 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 180
8 UIKit 0x366c47d7 -[UIApplication handleEvent:withNewEvent:] + 1114
9 UIKit 0x366c4215 -[UIApplication sendEvent:] + 44
10 UIKit 0x366c3c53 _UIApplicationHandleEvent + 5090
11 GraphicsServices 0x36398e77 PurpleEventCallback + 666
12 CoreFoundation 0x311c3a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
13 CoreFoundation 0x311c583f __CFRunLoopDoSource1 + 166
14 CoreFoundation 0x311c660d __CFRunLoopRun + 520
15 CoreFoundation 0x31156ec3 CFRunLoopRunSpecific + 230
16 CoreFoundation 0x31156dcb CFRunLoopRunInMode + 58
17 UIKit 0x366eed49 -[UIApplication _run] + 372
18 UIKit 0x366ec807 UIApplicationMain + 670
19 Apptest 0x00002a0b main + 82
20 Apptest 0x000029b4 start + 40
)
terminate called after throwing an instance of 'NSException'
我希望你能帮助我。提前致谢。
最佳答案
MainWindow.xib
实际上在您的项目中存在吗?
您可能无意中删除了它。即使您从项目中删除了它,它也仍然可以在3GS上工作,因为它很可能仍在3GS的 bundle 软件中。
如果出现此类不一致的情况,我通常会清理项目并重置模拟器/从设备上卸载应用程序。