views:

49

answers:

1

I have a viewBased project and have two view "A" and "B" and put a button on view A and want to show view B when user push button.how can i show view B with navigation controler(means show with push) I use below code but don't know what should i do before this code(means how to setup UINavigation controler,...)

[self.navigationController pushViewController:second animated:YES];
A: 

Just pop view B from the nav controller.

So when you press the button in view B just do this:

[self.navigationController popViewControllerAnimated:YES]

Here is a tutorial on how to set up a nav controller with three views and buttons to change. Navigation Controller Tutorial

Matt
when i touch button on view A doesn't show view B(means code doesn't work)
O sorry misunderstood you, are your views set up within a navigation controller?
Matt
No,just i create two view
I added a link to my post with a tutorial to set up a navigation controller and do exactly as what you are describing.
Matt