Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 线程1程序收到信号SIGABRT_Iphone_Ios4_Memory_Error Handling_Compiler Errors - Fatal编程技术网

Iphone 线程1程序收到信号SIGABRT

Iphone 线程1程序收到信号SIGABRT,iphone,ios4,memory,error-handling,compiler-errors,Iphone,Ios4,Memory,Error Handling,Compiler Errors,这就是输出框告诉我的。在您使用的代码中的某个地方 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: (0x310

这就是输出框告诉我的。

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

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) 
但传递的路径值为零。

检查您的字符串。

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

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:]
但传递的路径值为零。

检查您的字符串。

-(void)playOnce:(NSString)aSound{/
-(void)playOnce:(NSString)aSound{/重要的错误是
'NSInvalidArgumentException'
,正如错误所说,问题是其中一个字符串不应该为null。根据您尝试执行的操作,此帖子可能会有所帮助:

重要的错误是
'NSInvalidArgumentException'
,正如错误所说,问题在于此字符串中的e为空,不应为空。根据您尝试执行的操作,此帖子可能会有所帮助:

您在设备上的路径为零

[NSURL initFileURLWithPath:]
首先,尝试清理您的项目

然后,确保在“复制捆绑资源”构建阶段复制文件


正如安娜·卡列尼娜所建议的,确保以区分大小写的方式处理名称。

设备上的路径为零

首先,尝试清理您的项目

然后,确保在“复制捆绑资源”构建阶段复制文件



正如安娜·卡列尼娜所建议的,确保以区分大小写的方式处理名称。

-(void)playOnce:(NSString)aSound{NSString*path=[[NSBundle mainBundle]pathForResource:aSound of type:@“caf”];AVAudioPlayer theAudio=[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path]错误:NULL];[theAudio setDelegate:self];[theAudio setNumberOfLoops:0];[theAudio setVolume:1.0];[theAudio play];这是我四个拥有[NSURL initFileURLWithPath:]-(void)playOnce:(NSString)aSound{NSString*路径=[[NSBundle mainBundle]资源路径:aSound of Type:@“caf”];AVAudioPlayer theAudio=[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path]错误:NULL];[theAudio setDelegate:self];[theAudio setNumberOfLoops:0];[theAudio setVolume:1.0];[theaudioplay];这是具有[NSURL initFileURLWithPath:]-(void)playtone:(NSString*)aSound;-(void)playtlooped:(NSString*)的代码aSound;我需要添加什么来修复此问题program@alfred当前位置在我的评论中answer@alfred:添加文件时,是否选中了表示您的文件包含在项目中的复选框?@alfred:调试时,NSString是nil,aSond还是path?-(void)playOnce:(NSString*)aSound;-(void)playLooped:(NSString*))aSound;我需要添加什么来修复此问题program@alfred当前位置在我的评论中answer@alfred:添加文件时,是否选中了表示您的文件已包含在项目中的复选框?@alfred:调试时,NSString是nil、aSond还是path?-(void)playOnce:(NSString*)aSound;-(void)playLooped:(NSString*)aSound;-(iAction)beatButton1;-(iAction)切换回:(id)发送方;//切换回主页@End这是.h文件代码-(void)dealoc{-(void)playOnce:(NSString)aSound{NSString*path=[[NSBundle mainBundle]pathForResource:aSound of type:@“caf”];AVAudioPlayer theAudio=[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL filewithpath:path]错误:NULL];[theAudio setDelegate:self];[theAudio setNumberOfLoops:0];[theAudio setVolume:1.0];[theAudio play];}-(void)playLooped:(NSString)aSound{NSString*路径=[[NSBundle mainBundle]资源路径:类型为@“caf”];AVAudioPlayer音频=[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:路径]错误:NULL];[theAudio setDelegate:self];//无限循环[theAudio setNumberOfLoops:-1];[theAudio setVolume:1.0];[theAudio play];[theAudio release];}设备区分大小写。请确保音频中的路径与资源名称完全匹配(错误说明路径参数为零)。请参阅。-(void)playOnce:(NSString*)aSound;-(void)playLooped:(NSString*)aSound;-(iAction)beatButton1;-(iAction)switback:(id)sender;//切换回主页@end,这是.h文件代码-(void)dealoc{-(void)playOnce:(NSString)aSound{NSString*路径=[[NSBundle mainBundle]路径资源:aSound of type:@“caf”];AVAudioPlayer theAudio=[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path]错误:NULL];[theAudio setDelegate:self];[theAudio setNumberOfLoops:0];[theAudio setVolume:1.0];[theAudio play];}-(void)playLooped:(NSString)aSound{NSString*路径=[[NSBundle mainBundle]路径资源:类型的范围:@“caf”];AVAudioPlayer音频=[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path]错误:NULL];[theAudio setDelegate:self];//无限循环[theAudio setNumberOfLoops:-1];[theAudio setVolume:1.0];[theAudio play];[theAudio release];}设备区分大小写。请确保音频中的路径与资源名称完全匹配(错误说明路径参数为零)。请参阅。我只是尝试播放按钮声音我只是尝试播放按钮声音您的第二点对我很有用。由于某种原因,当我将CAF文件拖到项目中时,它没有将它们放入“复制包资源”中你的第二点对我很有用。由于某种原因,当我把我的CAF文件拖到我的项目中时,它没有把它们放到“复制包资源”中