TTURLMap - 在哪里填充它?

发布于 2024-11-14 16:57:18 字数 980 浏览 2 评论 0原文

我一直在使用 Three20 框架,并且希望首先利用它的启动器方面。我一直在阅读有关 TTNavigatorTTURLMap 的内容。因此,如果我是正确的,以下代码片段将实现相同的功能。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

腹黑女流氓 2024-11-21 16:57:18

您是否使用某种方法(例如 applicationDidFinishLaunching: 方法)填充所有视图控制器,并在所有视图控制器中仅使用 openURLAction: ?

是的。

您还可以使用 TTTableLinkedItem 打开链接。

Do you populate all your view controllers in some method like applicationDidFinishLaunching: method and just use the openURLAction: in all your view controllers?

Yes.

You also use TTTableLinkedItem's to open links.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文