Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何实现sectionIndexTitlesForTableView:和tableView:sectionForSectionIndexTitle:atIndex:方法_Ios_Objective C_Realm - Fatal编程技术网

Ios 如何实现sectionIndexTitlesForTableView:和tableView:sectionForSectionIndexTitle:atIndex:方法

Ios 如何实现sectionIndexTitlesForTableView:和tableView:sectionForSectionIndexTitle:atIndex:方法,ios,objective-c,realm,Ios,Objective C,Realm,我使用的是Realm v0.98.1和RBQFetchedResultsController 基本上,我想要一个tableview列表,其中节头名称作为第一个字母&节索引标题以及搜索功能 问题在于,RBQFetchedResultsController与NSFetchedResultsController在以下方面不同,因为它不提供以下方法: - [self.fetchedResultsController sectionIndexTitles] - [self.fetchedResultsCo

我使用的是Realm v0.98.1和
RBQFetchedResultsController

基本上,我想要一个tableview列表,其中节头名称作为第一个字母&节索引标题以及搜索功能

问题在于,
RBQFetchedResultsController
NSFetchedResultsController
在以下方面不同,因为它不提供以下方法:

- [self.fetchedResultsController sectionIndexTitles]
- [self.fetchedResultsController sectionForSectionIndexTitle:title atIndex:index]
另一个问题是,我想像这个问题中回答的那个样,把数字排在字母后面

我想这是RBQSortDescriptor当前的一个限制,因为它没有提供以下方法:

+(RBQSortDescriptor *)sortDescriptorWithKey:ascending:comparator:

如何使用任何替代解决方案来解决这些问题?

RBQFetchedResultsController有两种方法可以获取这些信息:

//检索给定节索引的标题
-(NSString*)标题标题标题部分:(NSInteger)部分
//检索给定节名称的节索引
-(nsInteger)sectionIndexForSectionName:(NSString*)sectionName

是的,目前我正在使用这些方法&在[self.fetchedResultsController sectionIndexTitles]方法中提供a-z的硬编码数组。如何获取节名数组,以便在[self.fetchedResultsController sectionIndexTitles]方法中提供该数组?啊,API不提供这一点,但添加也不会太困难。今天我会用公关来补充这一点。