0
所以分析器现在告诉我,我有一个内存泄漏。在下面的功能中,它表示'分配到'音频'的对象的潜在泄漏内存泄漏,我似乎无法解决
我认为它说的是实话,因为该应用程序运行良好几分钟,然后慢慢崩溃。
我试过'autorelease',但它告诉我'对象发送过多次autorelease'。
对不起是一个害虫,但有没有人有任何想法呢?
-(void) playFile:(NSString*) nameOfFile { // plays audio file passed in by a string
fileLocation = nameOfFile;
NSString *path = [[NSBundle mainBundle] pathForResource:nameOfFile ofType:@"mp3"];
AVAudioPlayer* theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath: path] error:NULL];
[theAudio play];
[fileLocation release];
}