我对三人来说相当新,所以请耐心等待。我有以下代码将对象加载到数据源:
- (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执行此操作吗?
答案 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]