0
Q
多索引路径
A
回答
0
我不完全确定你的问题,但它听起来像你想要一个表,其中一节包含NSFetchedResultController的结果,另一节包含来自其他源的数据。这很容易做到。如果您的数据可以不需要在多个部分,然后它很容易,只要得到fetchedResultController为第0,和别的数据为第1
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if(section == 0){
id sectionInfo = [[fetchedResultsController sections] objectAtIndex:section];
return [sectionInfo numberOfObjects];
}else{
return self.someArray.Count;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if(indexpath.section == 0){
static NSString *CellIdentifier = @"data cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSObject *foo = [self.fetchedResultController objectAtIndexPath:indexPath];
//configure cell
return cell;
}else{
static NSString *CellIdentifier = @"some other cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
//configure cell
return cell;
}
}
相关问题
- 1. CherryPy索引路径
- 2. XMLTYPE提取多个路径/索引
- 3. 从UISearchDisplayController获取self.tableview索引路径tableView索引路径
- 4. 索引路径索引目录
- 5. 资源的路径索引
- 6. 索引访问路径
- 7. 变量行索引路径
- 8. htaccess忽略/索引/路径
- 9. 索引路径0行
- 10. 路由器链接到索引路径
- 11. Typo3索引搜索Local_Lang路径
- 12. 地图索引多途径
- 13. 更改索引路径后CakePHP出错
- 14. UITableView中的NSDictionary - 使用索引路径
- 15. 在NSDictionary中存储索引路径
- 16. _shouldShowMenuForCell中的意外nil索引路径
- 17. 无效索引路径错误
- 18. 如果不能使用索引路径
- 19. 获取UiTableView标头的索引路径?
- 20. 非法字符在索引路径16
- 21. Rails 3 - 缺少索引路径?
- 22. 设置索引路径供参考
- 23. 路径不能通过谷歌索引
- 24. 索引路径上的UISearchController崩溃
- 25. 使用索引路径查询XMl
- 26. PHP路径中的未定义索引
- 27. UITableViewCell显示索引路径行乱序
- 28. 获取UITablieViewCell的索引路径
- 29. 获取表格的索引路径
- 30. UICollectionView无效索引路径崩溃
谢谢你,这就是我一直在寻找。 – Luke 2012-07-07 21:13:30