2011-08-31 6 views
0

MediaViewController를 제공하는보기 컨트롤러가 있고 그 후 첫 번째보기를 닫을 수 없습니다.MediaPlayerViewController를 닫은 후에 VIewController를 닫을 수 없습니다.

양쪽보기가 애니메이션으로 해제되면 분명히 작동하지 않을 수 있습니다. 예,하지만 모든 변형을 시도했지만 여전히 운이 없습니다.

내가 만들고 다음 코드의 의견

-(void)videoPlayBackDidFinish:(NSNotification*)notification 
{  
    AppstersAppDelegate *appDelegate = (AppstersAppDelegate *)[[UIApplication sharedApplication] delegate]; 

    // [appDelegate continueSetup]; 

    [self dismissMoviePlayerViewControllerAnimated]; 

    [appDelegate.viewController dismissModalViewControllerAnimated:NO]; 
} 

를 기각한다 그래서

MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:fileURL]; 
    [mp moviePlayer].controlStyle = MPMovieControlStyleNone; 
    [[mp moviePlayer] prepareToPlay]; 
    [[mp moviePlayer] setShouldAutoplay:YES]; 
    [mp moviePlayer].fullscreen = YES; 
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:nil]; 

    [self presentMoviePlayerViewControllerAnimated:mp]; 

처럼 MediaPlayerViewController을 제시

AppDelegate에에의 ViewController 내가 또한 호출하려고 한 rootViewController

입니다 자체 dismissModalViewControllerAnimated하지만 문제를 해결하지 못했습니다.

이상한 일은 movieViewController를 표시하는 각보기에서 일어나는 일입니다.

답변

0

시도 [self.parentViewController dismissModalViewControllerAnimated];

관련 문제