我释放了MPMoviePlayerController,但内存分配和存活对象仍比对象分配前高。然而,如果我重新分配对象,它不会泄漏更多。
我的应用程序实际上使用了大量媒体文件,内存消耗很高。我想完全释放不需要的内存,以避免内存警告。
电影播放器释放:
player.initialPlaybackTime = -1;
[player.view removeFromSuperview];
[player stop];
[player release];
影片播放器分配:
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"video0_hd.mov" ofType:nil]];
player = [[MPMoviePlayerController alloc] initWithContentURL:url];
player.view.frame = placeholder.frame;
[self.view addSubview:player.view];
[player play];