开发者

What should be in a NavigationController

I have a table view which is inside a navigation controller, however besides this the navigation controller does nothing else. So the class is pretty useless. I also have a navigation controller, which has a m开发者_运维技巧apviewcontroller inside, other than that.. it has nothing else.

I know the job is important, that it navigates views back and forth. But is this the way it's supposed to be?


UINavigationControllers are used to manage a stack of UIViewControllers. To be more specific, you should be housing your table and map in UIViewControllers.

Say, for example, an element in your table links to an instance of your map, you might

[self.navigationController pushViewController:mapVC animated:YES];

in the table view delegates' didSelectRow:atIndexPath:

Strictly speaking, there a very few instances where you need to extend the UINaviagtionController class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜