当我尝试从我的iPhone(位于documentsDirectory中)播放视频时,我在使用iOS 5时遇到了以下错误,而在iOS 4.3上运行良好:
一个AVPlayerItem类的实例0x168da0在键值观察者仍然注册它时被释放了。观察信息已经泄漏,甚至可能被错误地附加到其他对象上。在调试器中设置NSKVODeallocateBreak断点以停止此处。以下是当前的观察信息: ( Context: 0x0, Property: 0x10b570> Context: 0x0, Property: 0x117ab0> )
以下是代码摘录:
一个AVPlayerItem类的实例0x168da0在键值观察者仍然注册它时被释放了。观察信息已经泄漏,甚至可能被错误地附加到其他对象上。在调试器中设置NSKVODeallocateBreak断点以停止此处。以下是当前的观察信息: ( Context: 0x0, Property: 0x10b570> Context: 0x0, Property: 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];