MPMoviePlayerContentPreloadDidFinishNotification不会触发[iPhone]

时间:2009-12-03 09:17:14

标签: iphone mpmovieplayercontroller

我遇到了MPMoviePlayerContentPreloadDidFinishNotification通知的问题。 我已经注意接收MPMoviePlayerContentPreloadDidFinishNotification通知和MPMoviePlayerPlaybackDidFinishNotification,但第一个从未触发。 这是固件OS 3.0中的错误吗?也许固定在3.1?要么 ?因为我的divice和similator是3.0也许这是一个bug?

我的代码:

...
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MovieDidLoad:) name:MPMoviePlayerContentPreloadDidFinishNotification object:nil];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(MovieDidLoad:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
...
-(void)MovieDidLoad:(NSNotification*)notification
{
    UIAlertView *alert = [[UIAlertView alloc] 
                          initWithTitle:@"Notification Listener" 
                          message:@"Notification Listener invoked" 
                          cancelButtonTitle:@"Ok dude!" 
                          otherButtonTitles:nil];   
    [alert show]; 
    [alert release];    

}

始终触发MPMoviePlayerPlaybackDidFinishNotification,但永远不会触发MPMoviePlayerContentPreloadDidFinishNotification。 有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我回答了一个类似的问题here并找到了解决方法。这不是理想的,但如果找不到其他解决方案,可能值得一看?