三个网址导航20

时间:2011-07-02 04:12:16

标签: iphone objective-c three20

我对三人来说相当新,所以请耐心等待。我有以下代码将对象加载到数据源:

- (void)loadView {
    [super loadView];
    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
    RKObjectTTTableViewDataSource* dataSource = [RKObjectTTTableViewDataSource dataSource];
    [dataSource mapObjectClass:[Group class] toTableCellClass:[CCell class]];
    RKObjectLoader* objectLoader = [[RKObjectManager sharedManager] objectLoaderWithResourcePath:@"/groups.json" delegate:nil];
    dataSource.model = [RKObjectLoaderTTModel modelWithObjectLoader:objectLoader];
    self.dataSource = dataSource;
}

我在appdelegate中设置了一个URL地图,如下所示:

TTNavigator *navigator = [TTNavigator navigator];
    navigator.window = self.window;

    TTURLMap *map = navigator.URLMap;
    [map from:@"tt://topics/(initWithTopicsIndex:)" 
    toSharedViewController:[TopicsViewController class]];

当我点击单元格时,我想推另一个控制器,我该怎么做?我可以通过TTTableViewCell中的setObject执行此操作吗?

1 个答案:

答案 0 :(得分:0)

您的item类需要在URLValue方法中返回您要导航到的URL。 URLValue在NSObject上的类别中实现,并使用URLMap为对象创建URL。

如果您的项目是TTTableLinkedItem的子类,则它具有URL属性,而是使用该属性。

查看[TTTableViewController didSelectObject:(id)object atIndexPath:(NSIndexPath*)indexPath]

[TTTableViewDelegate tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath]