views:

193

answers:

1

I am new to iphone development.I have created a button in UIView controller.On clicking the button it navigates to a another UITableView controller .On clicking the row of the table leads to another UIView controller which has also another table in it.On clicking the row of this table leads to another UIWebView.I have created a custom back button placed on the navigation bar of the UIView controllers and UIWebview.On clicking on the back button just leads me to the main page with a button and not to its just previous UIView.

-(IBAction) goemenbutton : (id) sender 
{

[self.view removeFromSuperview];

}

The above method is used for all the custom back button.Please help me out to get the correct flow for the back button.Thanks.

+1  A: 

You should probably look at using UINavigationController instead of interchanging several views within one UIViewController. The UINavigationController takes care of a lot of things for you, including back buttons with proper titles and nice animations. It also helps you structure your code and gives you more flexibility down the road.

A UIWebview is not a UIViewController and can not be pushed onto the NavigationController. You should probably look at wrapping it into a UIViewController.

Felix
i am not able to create the landing page where i need a button ,on clicking it leads to tableView,How can i create a button in navigation controller
Warrior
Create a UIViewController with a view and a button in it, then set this VC as the rootViewController of your UINavigationController.
Felix
Sorry for the delay.Thanks your suggestion worked a lot
Warrior