无法仅在iPhone 4上加载名为“MainWindow”的捆绑包[…]中的NIB

无法仅在iPhone 4上加载名为“MainWindow”的捆绑包[…]中的NIB,iphone,crash,xib,mainwindow,Iphone,Crash,Xib,Mainwindow,我的应用程序有问题。它在我的iPhone3GS上工作得很好,但现在我试着在iPhone4上测试它,它在屏幕可见时崩溃了 这是日志: 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/mo

我的应用程序有问题。它在我的iPhone3GS上工作得很好,但现在我试着在iPhone4上测试它,它在屏幕可见时崩溃了

这是日志:

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的捆绑包中


我通常会清理我的项目,如果出现类似的不一致情况,我会重置模拟器/从设备上卸载应用程序。

该文件存在于文件夹en.lproj中,我从iPhone上删除了该应用程序,但没有任何更改。我还从项目中删除了引用,并准备将其归档到项目中,但这没有帮助,它仍在3GS上运行,但在4上没有。对此我能做些什么?我可以以某种方式重新生成MainWindow.xib吗?清洁20多次也没用。这听起来很相似