Combine TabBar and Navigation Bar how to pushViewController? [closed]
I drag a TabBar controller into "MainWindow.xib", then put a Na开发者_JS百科vigation 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: ?
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];
精彩评论