views:

325

answers:

1

Hello,

I am developing a application in which I need to provide navigate to backward screen programmatically, in which there are two scenarios:

  1. There will one MainWindow.xib and few buttons on it, click of any one button will load another appropriate screen. On this screen, I need to put back button, click of which will load MainWindow.xib again and user can choose some other option.

  2. Except the above scenario, also all the screens will contain back button, click of which will load the previous again and user can choose some other option.

Regards, Pratik

+1  A: 

You want to use the UINavigationController for this. See the link for the documentation and example projects. I can't really give a full example here, but you can get started with the "Navigation-Based Application" template in XCode.

The general idea is that you push and pop views to/from a UINavigationController, and it will handle the back button and navigation toolbar for you. It's pretty straight forward.

Mike Weller
No I am not using UINavigationController, all are simple views.
pratik
Well... you need to use a UINavigationController and push your views into it.
Mike Weller