NSFetchedResultsController sectionIndexTitles错误不是英文字母

时间:2012-06-05 13:55:41

标签: iphone ios uitableview core-data nsfetchedresultscontroller

我有俄语版俄语名字的艺术家数据库 以下方法显示正确的俄语字母

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
    return [sectionInfo name];
}

但是当我想要显示索引行时:

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
    return [self.fetchedResultsController sectionIndexTitles];
}

部分字母就像这样“?”如何解决这个问题?

1 个答案:

答案 0 :(得分:4)

需要子类NSFetchedResultsController来覆盖- (NSString *)sectionIndexTitleForSectionName:(NSString *)sectionName { //or get substring return sectionName; }