TTURLMap - 在哪里填充它?
我一直在使用 Three20
框架,并且希望首先利用它的启动器方面。我一直在阅读有关 TTNavigator
和 TTURLMap
的内容。因此,如果我是正确的,以下代码片段将实现相同的功能。
LoginViewController *login = [LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil];
[[appdelegate navigationControler] pushViewController:login];
[login release];
并
TTNavigator *navigator = [TTNavigator navigator];
TTURLMap *map = [navigator URLMap];
[map from:@"tt://LoginViewController/initWithNibName:/bundle:" toViewController:[LoginViewController class]];
调用
[[TTNavigator navigator] openURLAction:
[[TTURLAction actionWithURLPath:@"tt://LoginViewController/LoginView/"] applyAnimated:YES]]
所以,我现在的问题是,什么时候用 URL 和视图控制器填充 TTURLMap
?您是否使用诸如 applicationDidFinishLaunching:
方法之类的方法填充所有视图控制器,并在所有视图控制器中仅使用 openURLAction:
?或者您是否根据需要填充地图,这在工作量/样板代码方面确实没有节省任何东西?
谢谢,
特贾。
I've been playing around with the Three20
framework and I'm looking to utilize the launcher aspect of it for starters. I've been reading about TTNavigator
and TTURLMap
. So if I'm correct, the following pieces of code achieve the same functionality.
LoginViewController *login = [LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil];
[[appdelegate navigationControler] pushViewController:login];
[login release];
and
TTNavigator *navigator = [TTNavigator navigator];
TTURLMap *map = [navigator URLMap];
[map from:@"tt://LoginViewController/initWithNibName:/bundle:" toViewController:[LoginViewController class]];
and invoking
[[TTNavigator navigator] openURLAction:
[[TTURLAction actionWithURLPath:@"tt://LoginViewController/LoginView/"] applyAnimated:YES]]
So, my question now is, when do you populate the TTURLMap
with the URLs and the View Controllers? Do you populate all your view controllers in some method like applicationDidFinishLaunching:
method and just use the openURLAction:
in all your view controllers? Or do you populate the map on an as needed basis, which really doesn't save anything in terms of effort / boiler plate code?
Thanks,
Teja.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的。
您还可以使用
TTTableLinkedItem
打开链接。Yes.
You also use
TTTableLinkedItem
's to open links.