【发布时间】:2011-08-05 08:00:19
【问题描述】:
- (IBAction) btnFire:(id)sender {
NSString *path = [NSString stringWithFormat:@"%@%@", [[NSBundle mainBundle] resourcePath], @"/gunShot.wav"];
NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
AVPlayer *shotSound = [[AVPlayer alloc] initWithURL:filePath];
[shotSound play];
}
如果我在这里释放 shotSound,它就不会播放。同时没有泄漏。
为什么仪器显示没有泄漏?如何释放shotSound?
【问题讨论】:
标签: iphone xcode memory-management