【发布时间】:2011-05-10 01:02:53
【问题描述】:
我在至少三个教程中看到过这段小代码,当我按下连接到我得到的操作的按钮时:
'NSInvalidArgumentException',原因:'* -[NSURL initFileURLWithPath:]: nil string parameter'
它说我的路径是空的,它是根据控制台。关于我缺少什么的任何想法?
-(IBAction) pushStart
{
NSString *arrowSoundPath = [[NSBundle mainBundle] pathForResource:@"Arrow.mp3" ofType:@"mp3"];
NSLog(@"%@",arrowSoundPath);
AVAudioPlayer *theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:arrowSoundPath] error:NULL];
theAudio.delegate = self;
[theAudio play];
}
【问题讨论】:
标签: iphone objective-c audio mp3