Tag Archives: navigation

Navigating views on iPhone.

Its been awhile since I’ve posted anything, but I’ve been obsessing over an iPhone application.  I have three views set and was able to switch forward to next views pretty easily following several online tutorials that were available.  My favorite of which is this blog/tutorial.

That’s all well and good that I can move my views forward but how do I go back?  For this, I had to use some time, Google and Apple’s references and was able to find how to utilize the navigation controller.  See, my views did not have room for a navigation bar but I had used buttons to do the same.

After much testing and research, I found this simple line of code to move the page back.  In fact, once I used that everything about the navigation controller began to make sense!  I was just sad that there were no blog posts, tutorials or forums that had this method listed, so I decided to make sure there was at least one!

// Method: - (UIViewController *)popViewControllerAnimated:(BOOL)animated

-(IBAction)pageBack:(id)sender {
	[self.navigationController popViewControllerAnimated:YES];
}