求助!我在iOS模拟器上可以播放声音,但无法在我的设备上播放!以下是我的代码(是的,音频文件位于指定位置,肯定有效):
SystemSoundID hashtag;
NSString *path = [[NSBundle mainBundle] pathForResource:@"hashtag" ofType:@"wav"];
NSURL *pathURL = [NSURL fileURLWithPath:path];
AudioServicesCreateSystemSoundID((__bridge CFURLRef) pathURL, &hashtag);
AudioServicesPlaySystemSound(hashtag);