抛出“NSException”实例后调用终止(gdb)

发布于 2024-12-04 04:28:38 字数 2371 浏览 1 评论 0原文

我花了 6 个月的时间制作了一个应用程序,没有任何备份。它在模拟器上运行良好,但在设备上崩溃。

这是错误代码:

2011-09-11 17:55:49.172 Apli[223:707] * 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“无法在捆绑包中加载 NIB:”NSBundle /var/mobile/Applications/FC234696-314B-4328-94BF-A73506B8AB07/Apli.app> (已加载)',名称为“MainWindow”

*** Call stack at first throw:
(
    0   CoreFoundation                      0x3438664f __exceptionPreprocess + 114
    1   libobjc.A.dylib                     0x36879c5d objc_exception_throw + 24
    2   CoreFoundation                      0x34386491 +[NSException raise:format:arguments:] + 68
    3   CoreFoundation                      0x343864cb +[NSException raise:format:] + 34
    4   UIKit                               0x34b03a53 -[UINib instantiateWithOwner:options:] + 1110
    5   UIKit                               0x34b04e09 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
    6   UIKit                               0x3492f4cd -[UIApplication _loadMainNibFile] + 96
    7   UIKit                               0x34929b09 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 180
    8   UIKit                               0x348fe7d7 -[UIApplication handleEvent:withNewEvent:] + 1114
    9   UIKit                               0x348fe215 -[UIApplication sendEvent:] + 44
    10  UIKit                               0x348fdc53 _UIApplicationHandleEvent + 5090
    11  GraphicsServices                    0x33a56e77 PurpleEventCallback + 666
    12  CoreFoundation                      0x3435da97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
    13  CoreFoundation                      0x3435f83f __CFRunLoopDoSource1 + 166
    14  CoreFoundation                      0x3436060d __CFRunLoopRun + 520
    15  CoreFoundation                      0x342f0ec3 CFRunLoopRunSpecific + 230
    16  CoreFoundation                      0x342f0dcb CFRunLoopRunInMode + 58
    17  UIKit                               0x34928d49 -[UIApplication _run] + 372
    18  UIKit                               0x34926807 UIApplicationMain + 670
    19  Apli                                 0x00002bb3 main + 82
    20  Apli                                0x00002b5c start + 40
)
terminate called after throwing an instance of 'NSException'
(gdb) 

I've made an app with 6 months of work with no backups. It works fine on Simulator but on device it crashes.

This is the error code:

2011-09-11 17:55:49.172 Apli[223:707] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle /var/mobile/Applications/FC234696-314B-4328-94BF-A73506B8AB07/Apli.app> (loaded)' with name 'MainWindow''

*** Call stack at first throw:
(
    0   CoreFoundation                      0x3438664f __exceptionPreprocess + 114
    1   libobjc.A.dylib                     0x36879c5d objc_exception_throw + 24
    2   CoreFoundation                      0x34386491 +[NSException raise:format:arguments:] + 68
    3   CoreFoundation                      0x343864cb +[NSException raise:format:] + 34
    4   UIKit                               0x34b03a53 -[UINib instantiateWithOwner:options:] + 1110
    5   UIKit                               0x34b04e09 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
    6   UIKit                               0x3492f4cd -[UIApplication _loadMainNibFile] + 96
    7   UIKit                               0x34929b09 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 180
    8   UIKit                               0x348fe7d7 -[UIApplication handleEvent:withNewEvent:] + 1114
    9   UIKit                               0x348fe215 -[UIApplication sendEvent:] + 44
    10  UIKit                               0x348fdc53 _UIApplicationHandleEvent + 5090
    11  GraphicsServices                    0x33a56e77 PurpleEventCallback + 666
    12  CoreFoundation                      0x3435da97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
    13  CoreFoundation                      0x3435f83f __CFRunLoopDoSource1 + 166
    14  CoreFoundation                      0x3436060d __CFRunLoopRun + 520
    15  CoreFoundation                      0x342f0ec3 CFRunLoopRunSpecific + 230
    16  CoreFoundation                      0x342f0dcb CFRunLoopRunInMode + 58
    17  UIKit                               0x34928d49 -[UIApplication _run] + 372
    18  UIKit                               0x34926807 UIApplicationMain + 670
    19  Apli                                 0x00002bb3 main + 82
    20  Apli                                0x00002b5c start + 40
)
terminate called after throwing an instance of 'NSException'
(gdb) 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泅人 2024-12-11 04:28:38

检查您的 MainWindow.XIB 文件是否仍在您的项目中,并且特别检查是否包含在您的目标中

我猜你的 MainWindow.xib 没有被检查是否包含在你的最终 Apli.app 包中,这解释了为什么在你的 Bundle 中找不到它。

如果您没有“清理”应用程序的先前版本,则编译的应用程序包的先前版本(包括 MainWindow.xib 文件)可能仍存在于模拟器中,这解释了模拟器仍然找到它的原因。 (如果您从“构建”菜单中“清除所有目标”,然后在模拟器上重建您的应用程序,我敢打赌模拟器也找不到您的 XIB 文件)

Check that your MainWindow.XIB file is still in your project, and especially is checked to be included in your target.

I guess that your MainWindow.xib is not check to be included to your final Apli.app package, that explains why it is not found in your Bundle.

If you didn't "Clean" your previous builds of your app, a previous version of your compiled app bundle, including the MainWindow.xib file, may still be present in your simulator, explaining why the simulator still finds it. (If you "Clean all targets" from the "Build" menu, then rebuild your app on the simulator, I bet the simulator won't find your XIB file neither)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文