I wish to restart a view controller.
What I've done is to pop the current view controller off the navigation stack, and push a new instance of the view controller onto the stack. However, this does not work. The current view controller is popped off the navigation stack but, the new instance is not pushed onto the stack.
Here is my code snippet:
[[self navigationController] popViewControllerAnimated:YES];
VideoPlayerViewController *videoPlayer = [[VideoPlayerViewController alloc] init];
[videoPlayer setMedia:media];
[[self navigationController] pushViewController:videoPlayer animated:YES];
[videoPlayer release];
videoPlayer = nil;
NSLog(@"Restarting view controller...");
Any idea what could be wrong?