我有以下代码:
SystemSoundID soundID;
NSString *soundFile = [[NSBundle mainBundle] pathForResource: _sound ofType:@ "wav"];
AudioServicesCreateSystemSoundID((__bridge CFURLRef) [NSURL fileURLWithPath:soundFile], &soundID);
AudioServicesPlaySystemSound(soundID);
[UIView animateWithDuration: 0.6f
delay: 0.1f
options: UIViewAnimationTransitionCurlUp
animations:^{
[appDelegate.presstobook setFrame: CGRectMake(136, appDelegate.window.frame.size.height - 50, 47, 47)];
}
completion:^(BOOL finished){
presstobook = NO;
}
];
如何在不影响其余代码的情况下播放声音?我根本不想播放声音来暂停代码?如何更改代码以便在不影响其余代码的情况下异步播放声音?谢谢!