【发布时间】:2011-11-07 10:56:27
【问题描述】:
当我尝试从我的 iPhone(位于文档目录中)播放视频时,我在使用 iOS 5 时收到以下错误,而它在 iOS 4.3 上运行良好:
类 AVPlayerItem 的实例 0x168da0 已被释放,而键值观察者仍向其注册。观察信息被泄露,甚至可能被错误地附加到其他对象上。在 NSKVODeallocateBreak 上设置断点以在调试器中停止。这是当前的观察信息: ( 上下文:0x0,属性:0x10b570> 上下文:0x0,属性:0x117ab0>
这里是代码摘录:
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:[appDelegate.mediaManager loadVideo:[element valueForAttributeNamed:@"value"]]];
//create a NSNotificationCenter which call moviePlaybackComplete function when video playback finished
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlaybackComplete:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayerController];
//display the moviePlayer view
[self.view addSubview:moviePlayerController.view];
moviePlayerController.fullscreen = YES;
[moviePlayerController play];
【问题讨论】:
标签: ios5 mpmovieplayercontroller