SystemSoundID soundID;
NSString *soundFile = [[NSBundle mainBundle]
pathForResource:@"deathsc" ofType:@"mp3"];
AudioServicesCreateSystemSoundID((__bridge CFURLRef)
[NSURL fileURLWithPath:soundFile], & soundID);
AudioServicesPlaySystemSound(soundID);
}
每当我在模拟器上运行这段代码时,它都能完美运行(听起来很可怕),但是当我在 iPad 上运行它时,游戏冻结了,如果我触摸屏幕,我会收到一个 sigkill 错误