@property (nonatomic, strong) NSURL * urlPath;
self.urlPath = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"bark" ofType:@"caf"]];
運行ARC,部署目標4.3。儀器泄漏self.urlPath =行。內存泄漏 - NSString&NSURL
self.urlPath稍後會在視圖出現後設置AVSoundPlayer。目前在Soundplayer上沒有任何泄漏,只有在NSURL線上。音頻會播放,但當視圖彈出時會發生內存泄漏。
,因爲我已經在這個任何想法>現在12小時...
是否使用ARC? – CodaFi
是的,我正在使用ARC。 – iOSProgrammingIsFun
嘗試使用'URLForResource:withExtension:'方法代替'pathForResource:',玩家也可能泄漏。 – mit3z