开发者

TTURLMap - Where do you populate it?

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 开发者_Python百科save anything in terms of effort / boiler plate code?

Thanks,

Teja.


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜