I'm using MPMoviePlayerController play online video (I'm using ARC), here's the code:
_moviePlayer = [[ZXMPMoviePlayerController alloc] init];
_moviePlayer.view.frame = CGRectMake(0, 100, 320, 320);
_moviePlayer.controlStyle = MPMovieControlStyleNone;
[self.view addSubview:_moviePlayer.view];
NSString *sourcePathStr = @""; //video url
_moviePlayer.contentURL = [NSURL URLWithString:sourcePathStr];
_moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
[_moviePlayer prepareToPlay];
[_moviePlayer play];
ZXMPMoviePlayerController is a subclass of MPMoviePlayerController in case of observing the deallocation of _moviePlayer.
Now I'm sure _moviePlayer is deallocated(because I printed log in dealloc method of ZXMPMoviePlayerController) after I leave this VC (VC is deallocated also.), but the memory usage of my app is still high, This is a test demo, the vc is clean except the movieplayer. I think it must be something of _moviePlayer is still in memory, like cache of something else, I have no idea...
Any ideas? Help...
in .h
@interface ZXMPMoviePlayerController : MPMoviePlayerController
@end
in .m #import "ZXMPMoviePlayerController.h"
@implementation ZXMPMoviePlayerController
- (void)dealloc
{
NSLog(@"%s",__FUNCTION__);
}
@end