【发布时间】:2010-07-05 23:01:40
【问题描述】:
我正在关注this 教程并在我的应用委托中声明以下映射:
[map from:@"x://profile/(initWithId:)/(name:)" toViewController:[ProfileViewController class]];
[map from:@"*" toViewController:[TTWebController class]];
在ProfileViewController.m 中,我实现了- (id)initWithId:(int)anIdentifier name:(NSString *)name 选择器来处理此类映射。我想打开像x://profile/1/John Doe 这样的URL 会调用[[ProfileViewController alloc] initWithId:1 name:@"John Doe"],但是,情况似乎并非如此。每次打开 URL 时都会调用默认的 TTWebController 类。
使用单个参数,即x://profile/(initWithId:) 之类的东西是正确的,即调用[[ProfileViewController alloc] initWithId:1]。
我在这里错过了什么吗? Three20和TTURLMap如何使用多参数映射?
【问题讨论】:
-
你需要使用 toViewController: 来传递数据,还是你也可以使用 toModalViewController: ?因为我正在使用 toModalViewController: 并传递一些数据,而当我使用的 initWithId: 方法被调用时,由于某种原因它实际上并没有打开视图。
标签: iphone objective-c three20