2010-06-11 3 views
0
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { 
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section]; 

if ([tempArray containsObject: [sectionInfo indexTitle]]) 
{ 
    [tempArray removeObjectAtIndex:[tempArray indexOfObject:[sectionInfo indexTitle]]];  
    return nil; 
}else 
{ 
    [tempArray addObject: [sectionInfo indexTitle]]; 
    return [sectionInfo indexTitle]; 

} 
return [sectionInfo indexTitle]; 

}jQuery과 섹션 헤더와 빈 알파벳순 세포 그러나 대신 해당 타이틀의 빈 회색 표시 헤더 그룹 상기

코드를 점멸. 헤더 수를 지정하지 않았기 때문에 이것이 가능할 수 있습니까? 이것은 자연스럽게 알파벳의 모든 문자에 대한 단일 헤더입니다. 셀 헤더가 흰색에서 회색으로 깜박이는 이유는 무엇입니까?

+0

3.2 용으로 빌드하면 위의 로직과 함께 작동합니다. 3.1.2 (내가하고있는)로 빌드하면 버그가 나타납니다. –

답변

1

tableView : titleForHeaderInSection에 대한 반복 호출 : [sectionInfo indexTitle] 및 nil이 번갈아 표시됩니다. 왜 놀라게 된거야?

+0

데이터가 사전 순으로 그룹화 된 응용 프로그램을 보았습니다. A 아래 문자 A로 시작하는 모든 셀, B 아래 B 등. 이것이 어떻게 성취 될 것인가? 잘못된 기능을 사용하고 있습니까? –

+0

올바른 함수를 사용하고 있지만 tempArray가 수행해야하는 작업을 이해할 수 없습니다. 전체 함수 본문을'return [sectionInfo indexTitle]; –

관련 문제