- (void)viewDidLoad {
SystemSoundID ReelStopSound;
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"spin" ofType:@"mp3" ];
CFURLRef soundURL = (CFURLRef)[NSURL fileURLWithPath:soundPath];
AudioServicesCreateSystemSoundID(soundURL, &ReelStopSound);
AudioServicesPlaySystemSound(ReelStopSound);
[super viewDidLoad];
}
当我在模拟器中运行这个应用程序时,它会播放 spin.mp3,但在我的 iPad 中却不是!