我在我的iPhone应用程序中有以下代码,警告内存泄漏!iPhone内存泄漏问题
这是我的代码
-(IBAction)playVideo:(id)sender {
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"test"
ofType:@"mov"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[moviePlayerController.view setFrame:CGRectMake(38, 100, 250, 163)];
[self.view addSubview:moviePlayerController.view];
moviePlayerController.fullscreen = YES;
[moviePlayerController play];
}
这是错误消息我得到: 分配上线37和存储到“moviePlayerController”
我对象的潜在泄漏尝试autorelease“moviePlayerController”然后我尝试释放它。这两种情况下内存泄漏都已解决,但视频无法在iPhone上播放!奇怪请帮忙。
可能重复的[如何释放MPMoviePlayerController?](http://stackoverflow.com/questions/695307/how-to-release-mpmovieplayercontroller) – albertamg