小编cos*_*smo的帖子

在ios tableview中,为什么section是NSIndexSet?

我是iOS开发的新手,所以这个问题非常愚蠢,但我确实很难弄清楚以下代码是如何工作的:

-(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];
   }
}
Run Code Online (Sandbox Code Playgroud)

为什么NSIndexSet代表这里的部分?另外,在这个例子sectionIndex中只是一个数字,它是否NSIndexSet只有一个数字?如果只有一个数字,为​​什么不用a int代表呢?

谢谢.

objective-c uitableview nsindexset ios

1
推荐指数
1
解决办法
613
查看次数

标签 统计

ios ×1

nsindexset ×1

objective-c ×1

uitableview ×1