나는이 질문은 매우 바보 그래서 아이폰 OS 개발 초보자,하지만 나는 다음과 같은 코드가 어떻게 작동하는지 알아내는 힘든 시간을 수행ios tableview에서 섹션이 NSIndexSet 인 이유는 무엇입니까?
-(void)controller:(NSFetchedResultsController *)controller didChangeSection:(id<NSFetchedResultsSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type{
if (type==NSFetchedResultsChangeDelete) {
[self.tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationAutomatic];
}
}
왜 NSIndexSet
여기에 섹션을 대표합니까? 또한이 예제에서 sectionIndex
은 숫자 일 뿐이며 NSIndexSet
은 하나의 숫자로 된 집합입니까? 숫자가 하나뿐이라면 왜 int
을 사용하면 되나요?
감사합니다.