iphone - 线程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;
}

当我在设备上运行它时,出现以下错误:

Thread 1:Program received signal: "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) 

这就是输出框告诉我的内容。

最佳答案

您在代码中使用的某个地方

[NSURL initFileURLWithPath:]

但您传递了一个nil路径值。
检查您的字符串。

https://stackoverflow.com/questions/8085556/

相关文章:

objective-c - Objective-C ISO C++禁止声明无类型的X

c# - C#—在Convert.ToInt32(...)之后,循环将不接受非数字输入

android - 构建Android源时编译错误

c# - 编译应用程序时,它会删除引用

syntax - D中的基本运算符重载(第2部分)

python - 您如何处理使用Scrapable FormRequest变灰的多个下拉表单

f# - 'NS.Type1'类型与f#中的 'NS.Type1

python - python程序显示编译错误

visual-c++ - C++语法错误: missing ';' before 'constant

sql-server - SQL Server中的编译错误和运行时错误之间的区别?