I have a view controller presenting a MediaViewController and after that I cannot get the first view to dismiss.
Apparently it might not work if both views are dismissed animated:YES, but I have tried all variants and still no luck.
I create and present the MediaPlayerViewController like so
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];
The following code should dismiss the views
-(void)videoPlayBackDidFinish:(NSNotification*)notification
{
AppstersAppDelegate *appDelegate = (AppstersAppDelegate *)[[UIApplication sharedApplication] delegate];
// [appDelegate continueSetup];
[self dismissMoviePlayerViewControllerAnimated];
[appDelegate.viewController dismissModalViewControllerAnimated:NO开发者_StackOverflow];
}
The viewController on the appDelegate is the rootViewController
I have also tried calling dismissModalViewControllerAnimated on self, but it didnt solve the issue.
The weird thing is that this is happening with each view that is presenting a movieViewController.
Try [self.parentViewController dismissModalViewControllerAnimated];
精彩评论