tags:

views:

217

answers:

1

I drag a TabBar controller into "MainWindow.xib", then put a Navigation controller into TabBar controller, So one of my tab page is navigation page. I set the root view of Navigation Controller (NavRootviewController.h / .m)

Give me one way to call -pushViewController: animated: ?

+1  A: 

You'll typically call pushViewController:animated: from your view controller in response to a button click, or in a method like tableView:didSelectRowAtIndexPath:. If you're pushing a UITableViewController subclass for example, you could do something like this in your root view controller:

YourTableViewController *controller = [[[YourTableViewController alloc] initWithStyle:UITableViewStylePlain] autorelease];
// Maybe set some properties on your controller here.
[self.navigationController pushViewController:controller animated:YES];
cduhn
Could you tell me if i drag a UINavigate Controller to my mainWindow, it means it has create an object named navigationController by default?Thank you!
Hey,Thank you so much , i found my problem is.