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