views:

22

answers:

1

There is an application which uses several view controllers. In one of them there is a button which switches to a new view, and there, in viewDidLoad method, I launch a video playback. But when it's stopped, an empty view pops up instead of the previous view I'm working with.

What is a proper way to switch back to the previous view automatically? I've read about MPMoviePlayerPlaybackDidFinishNotification so I can use it.

It's a navigation-based application.

+1  A: 

When you get the MPMoviePlayerPlaybackDidFinishNotification you just pop the current view controller with the popViewController... messages:

[yourViewController.navigationController popViewControllerAnimated: YES];

the navigationController property contains the active navigation controller.

see Apple docs for UINavigationController

David
Thank you, it works.
ufw