我的应用程序在我的Iphone上启动时崩溃 [英] My App crashes when launched on my Iphone

查看:274
本文介绍了我的应用程序在我的Iphone上启动时崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题:我的应用程序崩溃在我的Iphone(JB),虽然Xcode不抱怨什么。该应用程序在模拟器上可以正常工作。

I have a problem here : my app crashed on my Iphone (JB) though Xcode doesn't complain about anything. The app works fine on the simulator though.

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

However, there is this in the device logs :

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

任何想法可以是什么问题?
我已经花了一整天的时间,但...我被困了。

Any idea what the problem can be ? I've already spent my whole day on that, but... I'm stuck.

提前感谢...

Miky Mike

Miky Mike

好的,这是更多的从控制台,我得到这个:

Ok, Here is more then from the console, I get this :


这个GDB配置为
--host = i386-apple-darwin
--target = arm-apple-darwin.tty / dev / ttys002将程序加载到
debugger ...程序加载。 target
remote-mobile
/tmp/.XcodeGDBRemote-17280-65
切换到remote-macosx协议
mem 0x1000 0x3fffffff cache mem
0x40000000 0xffffffff none mem
0x00000000 0x0fff无运行正在运行...
启动远程程序时出错:
错误以获取进程456的任务。
启动远程程序:未能成功
获取进程任务正在调试的
程序不是
运行。正在调试的程序不是
正在运行。

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.

[开始于2010-12-23
20:33:33 +0100。 GNU gdb
6.3.50-20050815(Apple版本gdb-1472)(周四8月5日05:54:10 UTC
2010)版权所有2004免费软件
Foundation,Inc. GDB是自由软件,
由GNU General Public
许可证覆盖,并且欢迎您在特定条件下更改
和/或分发
的副本。键入show
copied查看条件。有
绝对不是GDB的保证。
有关详细信息,请输入show warranty。这个
GDB配置为
--host = i386-apple-darwin
--target = arm-apple-darwin.tty / dev / ttys004将程序加载到
debugger ...程序加载。 target
remote-mobile
/tmp/.XcodeGDBRemote-17280-72
切换到remote-macosx协议
mem 0x1000 0x3fffffff cache mem
0x40000000 0xffffffff none mem
0x00000000 0x0fff无运行正在运行...
启动远程程序时出错:
失败,以获取进程508的任务。
启动远程程序失败:
获取进程任务正在调试的
程序不是
运行。正在调试的程序不是
正在运行。

[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 *storeURL = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"TheLearningMachine.sqlite"]];

推荐答案

在你的应用程序的启动代码中,你正在调用 [NSURL fileURLWithPath:] ,它会引发异常。您需要检查要传递给它的字符串,可能会使用 NSLog()调用。

Somewhere in your app's startup code you're making a call to [NSURL fileURLWithPath:], and it's raising an exception. You need to check what string is being passed to it, perhaps with an NSLog() call.

wild猜测是传递给它的值是 nil ,因为任何代码生成的路径失败,由于某种原因。很难说,没有看到实际代码)

(My wild guess is the value being passed to it is nil, because whatever code generates that path is failing for some reason. It's hard to say without seeing the actual code)

这篇关于我的应用程序在我的Iphone上启动时崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆