SystemSoundID soundID; NSString *path = [[NSBundle mainBundle] pathForResource:@"static" ofType:@"caf"]; AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path],&soundID); AudioServicesPlaySystemSound(soundID);
我在我的应用程序中实现了上面的代码.
它运作完美,但问题是我不知道如何阻止它.
即声音为10秒.
10秒之前如果用户点击按钮,应该停止声音?我怎么能这样做?