I am working with iPhone app. I have to jump to the ProfileViewController(from HomeViewController) by following code:
ProfileViewController *ProfilePage = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
ProfilePage.RequestType = 2;
ProfilePage.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
UINavigationController *navigationControllerNew = [[UINavigationController alloc] initWithRootViewController:ProfilePage];
//Present navigationController as Model viw controller
[self.navigationController presentModalViewController:navigationControllerNew animated:YES];
//release it After presenting to it
[navigationControllerNew release];
[ProfilePage release];
Its working fine, but When I come back to same page after clicking on ProfileViewController’s “Last view” button, it comes back again but after coming back. My popToViewController on back button doesn’t work on HomeScreenController. Might be Because of new Navigation controller in the stack.
Where I am making mistake? How it can be implemented to work my Back button again?
You need not to use
popToViewControlleror something.Use
dismissModalViewControllerAnimated:method for coming back to the home view.