【发布时间】:2011-07-15 06:13:16
【问题描述】:
我正在关注教程here。
我的代码是:
- (void) didSelectObject:(id) object atIndexPath:(NSIndexPath*) indexPath
{
Group * group = (Group *)((RKMappableObjectTableItem *) object).object;
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
group.unread = 0;
[self.tableView reloadData];
TTURLAction *action = [[[TTURLAction actionWithURLPath:@"tt://group"]
applyQuery:[NSDictionary dictionaryWithObject:group forKey:@"kParameterUser"]]
applyAnimated:YES];
[[TTNavigator navigator] openURLAction:action];
}
我已将映射设置为:
[map from:@"tt://group" toSharedViewController:[TopicsViewController class]];
在我的 TopicsViewController 中我都试过了:
- (id) initWithNavigatorURL:(NSURL*)URL query:(NSDictionary*)query {
但它没有用。好像找不到任何映射。为什么是这样?我做错了什么?
更新:
这是根据建议更新的代码:
TTURLAction *action = [[[TTURLAction actionWithURLPath:@"tt://group"]
applyQuery:[NSDictionary dictionaryWithObject:group forKey:@"kParameterUser"]]
applyAnimated:YES];
[[TTNavigator navigator] openURLAction:action];
[map from:@"tt://group?" toSharedViewController:[TopicsViewController class] selector:@selector(initWithNavigationURL:)];
- (id) initWithNavigatorURL:(NSURL*)URL query:(NSDictionary*)query
我在这里做错了什么?
【问题讨论】:
标签: iphone objective-c ipad three20