2
是代码的MPMoviePlayerController释放问题
- (void)applicationDidFinishLaunching:(UIApplication *)application {
NSBundle *bundle = [NSBundle mainBundle];
NSString *moviePath = [bundle pathForResource:@"sample_mpeg4" ofType:@"mp4"];
NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain];
MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
moviePlayer.movieControlMode = MPMovieControlModeHidden;
[moviePlayer play];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlaybackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
}
- (void) moviePlaybackDidFinish:(NSNotification*)notification
{
MPMoviePlayerController *theMovie = [notification object];
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification
object:theMovie];
[theMovie stop];
[theMovie release];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
}
所以我的问题是我的应用程序的存储器使用量的额外3MB,甚至释放后停留在那里,这是否意味着内存没有得到释放?
我无法找到答这个阙任何地方 – Nnp 2010-02-02 19:24:39
一年后,你找到答案? – 0xDE4E15B 2011-01-31 21:38:46