开发者

presentModalViewController iPhone

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] initWithRootViewContro开发者_如何学JAVAller: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 don't need

UINavigationController *navigationControllerNew = [[UINavigationController alloc] initWithRootViewController:ProfilePage];

this should work

[self.navigationController presentModalViewController:ProfilePage animated:YES];


You need not to use popToViewController or something.

Use dismissModalViewControllerAnimated: method for coming back to the home view.


You can use the following command:

[self presentModalViewController:ProfilePage animated:YES]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜