线程1程序收到信号SIGABRT
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
当我在我的设备上运行它时,出现以下错误:
线程1:程序收到信号:“SIGABRT”。
我该如何解决这个问题?
2011-11-10 14:59:43.487 AVMultiPlayer[13554:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
*** First throw call stack:
(0x3102a8bf 0x381cf1e5 0x3102a7b9 0x3102a7db 0x3803e06f 0x3803e00b 0x2dc9 0x2b5d 0x30f84435 0x32fdf9eb 0x32fdf9a7 0x32fdf985 0x32fdf6f5 0x32fdf321 0x32fde485 0x32fddf01 0x32fc44ed 0x32fc3d2d 0x33bafe13 0x30ffe553 0x30ffe4f5 0x30ffd343 0x30f804dd 0x30f803a5 0x33baefed 0x32ff2743 0x25b5 0x2574)
terminate called throwing an exception(gdb)
这就是输出框告诉我的。
#import <UIKit/UIKit.h>
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
When I run it on my device it gives me the following error:
Thread 1:Program received signal: "SIGABRT".
How do i fix this?
2011-11-10 14:59:43.487 AVMultiPlayer[13554:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
*** First throw call stack:
(0x3102a8bf 0x381cf1e5 0x3102a7b9 0x3102a7db 0x3803e06f 0x3803e00b 0x2dc9 0x2b5d 0x30f84435 0x32fdf9eb 0x32fdf9a7 0x32fdf985 0x32fdf6f5 0x32fdf321 0x32fde485 0x32fddf01 0x32fc44ed 0x32fc3d2d 0x33bafe13 0x30ffe553 0x30ffe4f5 0x30ffd343 0x30f804dd 0x30f803a5 0x33baefed 0x32ff2743 0x25b5 0x2574)
terminate called throwing an exception(gdb)
That is what the output box tells me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在代码中的某个位置您使用
但传递了一个 nil 路径值。
检查你的字符串。
Somewhere in your code you use
but you pass a nil path value.
Check your string.
您的路径在设备上为零。
首先,尝试清理您的项目。
然后,确保在“复制捆绑资源”构建阶段复制文件
正如安娜·卡列尼娜所建议的,确保以区分大小写的方式处理名称。
Your path is nil on the device.
First, try cleaning your project.
Then, ensure the files are being copied over in the "Copy Bundle Resources" build phase
And as Anna Karenina suggested, make sure the names are being handled in a case sensitive manner.
重要的错误是
'NSInvalidArgumentException'
,正如错误所述,问题在于其中一个字符串不应该为 null。根据您想要执行的操作,这篇文章可能会有所帮助:正确使用 UIApplicationMainThe important error is
'NSInvalidArgumentException'
, and as the error says, the problem is that one of the strings is null that shouldn't be. Depending on what you're trying to do, this post may be of help: Proper use of UIApplicationMain