jjzjj

AudioServicesDisposeSystemSoundID

全部标签

iOS 8 : AudioServicesPlaySystemSound is not playing Sound when AudioServicesDisposeSystemSoundID is called afterwards

当调用AudioServicesPlaySystemSound时,它会很好地播放之前创建的SystemSound。但是当我之后直接调用AudioServicesDisposeSystemSoundID时,没有播放声音。似乎声音资源在播放之前就被处理掉了。但是在thisStackoverflow-Question人们说,有必要处理System-Sound以避免内存泄漏。这两种方法的正确方法是怎样的?我应该在几秒钟后用计时器调用Dispose-Method吗?或者创建一个单例,在第一次调用Play-Method时创建一次声音资源,并在单例的dealloc中处理资源?-(void)playS