【发布时间】:2016-06-02 04:32:32
【问题描述】:
我有以下代码初始化:
NSString *path = [NSString stringWithFormat:@"%@/test.mp3", [[NSBundle mainBundle] resourcePath]];
NSURL *soundUrl = [NSURL fileURLWithPath:path];
_audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:soundUrl error:nil];
然后一个按钮启动播放器
[_audioPlayer play];
所以当我在模拟器上时它可以正常工作,但在我的设备上却不能。
【问题讨论】:
标签: ios objective-c avaudioplayer audio-player