2011-01-24 5 views
0

제목/시작 화면에 작은 동영상을로드하려고합니다. 그러나 presentMoviePlayerViewControllerAnimated으로 전화하면 아무 일도 일어나지 않습니다. 코드 블록이 실행 중임을 확인했지만 사용자에게는 인식할만한 것이 없습니다.MPMoviePlayerViewController 나타나지 않습니다.

iPad를 타겟팅하므로 3.2로 간주됩니다.

도움을 주시면 감사하겠습니다.

- (void)viewDidLoad { 
    [super viewDidLoad]; 

    NSString *path = [[NSBundle mainBundle] pathForResource:@"Intro" ofType:@"m4v" inDirectory:nil]; 
    NSURL *fileURL = [NSURL fileURLWithPath:path]; 
    MPMoviePlayerViewController *playerView = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL]; 
    [[NSNotificationCenter defaultCenter] addObserver:self selector: @selector(playbackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:playerView.moviePlayer]; 
    [self presentMoviePlayerViewControllerAnimated:playerView]; 
    [playerView release]; 
} 

- (void)playbackDidFinish:(NSNotification*)aNotification { 
    MPMoviePlayerController *player = [aNotification object]; 
    [[NSNotificationCenter defaultCenter] removeObserver:self 
               name:MPMoviePlayerPlaybackDidFinishNotification 
               object:player]; 
    [player stop]; 
    [self dismissMoviePlayerViewControllerAnimated]; 
} 

답변

1

[playerView release]; 이후 이 줄 [self dismissMoviePlayerViewControllerAnimated];

관련 문제