Add a UINavigationBar to a UITableViewController without a UINavigationController

爷,独闯天下 提交于 2019-12-01 03:53:54

Did you change the connection in the XIB for the File's Owner view? It should point to your outer view which contains both the navbar and tableview.

But I'm not sure I understand why you don't want to use a navigation controller. Just do this:

MyViewController *viewController = [[[MyViewController alloc] init] autorelease];
UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:viewController] autorelease];
[self presentModalViewController:navController animated:YES];

I do this all the time when presenting a modal view - it seems cleaner than including a navbar directly in the view.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!