gpt4 book ai didi

iphone - 我的应用程序在我的 Iphone 上启动时崩溃

转载 作者:行者123 更新时间:2023-12-03 16:38:30 25 4
gpt4 key购买 nike

我有一个问题:我的应用程序在我的 Iphone (JB) 上崩溃了,尽管 Xcode 没有提示任何事情。该应用程序在模拟器上运行良好。

但是,设备日志中有这个:

Thread 0 Crashed:
0 libSystem.B.dylib 0x00078ac8 __kill + 8
1 libSystem.B.dylib 0x00078ab8 kill + 4
2 libSystem.B.dylib 0x00078aaa raise + 10
3 libSystem.B.dylib 0x0008d03a abort + 50
4 libstdc++.6.dylib 0x00044a20 __gnu_cxx::__verbose_terminate_handler() + 376
5 libobjc.A.dylib 0x00005958 _objc_terminate + 104
6 libstdc++.6.dylib 0x00042df2 __cxxabiv1::__terminate(void (*)()) + 46
7 libstdc++.6.dylib 0x00042e46 std::terminate() + 10
8 libstdc++.6.dylib 0x00042f16 __cxa_throw + 78
9 libobjc.A.dylib 0x00004838 objc_exception_throw + 64
10 CoreFoundation 0x0009fd0e +[NSException raise:format:arguments:] + 62
11 CoreFoundation 0x0009fd48 +[NSException raise:format:] + 28
12 Foundation 0x000125d8 -[NSURL(NSURL) initFileURLWithPath:] + 64
13 Foundation 0x000371e0 +[NSURL(NSURL) fileURLWithPath:] + 24

知道问题可能是什么吗?
我已经花了一整天的时间,但是...我被困住了。

提前致谢...

迈克迈克

好的,这是来自控制台的更多信息,我得到了这个:

This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys002 Loading program into debugger… Program loaded. target remote-mobile /tmp/.XcodeGDBRemote-17280-65 Switching to remote-macosx protocol mem 0x1000 0x3fffffff cache mem 0x40000000 0xffffffff none mem 0x00000000 0x0fff none run Running… Error launching remote program: failed to get the task for process 456. Error launching remote program: failed to get the task for process 456. The program being debugged is not being run. The program being debugged is not being run.

[Session started at 2010-12-23 20:33:33 +0100.] GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Thu Aug 5 05:54:10 UTC 2010) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys004 Loading program into debugger… Program loaded. target remote-mobile /tmp/.XcodeGDBRemote-17280-72 Switching to remote-macosx protocol mem 0x1000 0x3fffffff cache mem 0x40000000 0xffffffff none mem 0x00000000 0x0fff none run Running… Error launching remote program: failed to get the task for process 508. Error launching remote program: failed to get the task for process 508. The program being debugged is not being run. The program being debugged is not being run.



这是调用 URL 的代码

NSURL *storeURL = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] ​​stringByAppendingPathComponent: @"TheLearningMachine.sqlite"]];

我希望这将更好地为您阅读。

最佳答案

您的代码中的某些内容正在调用 [NSURL fileURLWithPath:]设备上的 URL 错误。此 URL 可能不正确,因为您引用的是设备上的硬编码路径。

检查您如何构建 URL - 模拟器在这里更能容忍问题。

您是否尝试调用类似 mailto: 或 callto: 的东西?

它也可能是其他问题的副作用,例如 this Japanese post那是在没有先调用 alloc 的情况下调用 init - 似乎与您具有相同的调用堆栈。

关于iphone - 我的应用程序在我的 Iphone 上启动时崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4521817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com