处理NSFetchedResultsController DidChangeSection IOS核心数据
我正在编写一个实现来处理处理NSFetchedResultsController DidChangeSection IOS核心数据,ios,core-data,nsfetchrequest,Ios,Core Data,Nsfetchrequest,我正在编写一个实现来处理NSFetchResultsControllerdidchange部分,但我收到了这个奇怪的警告 这是我的方法 - (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo atIndex:(NSUInteger)sectionIndex forChange
NSFetchResultsController
didchange部分,但我收到了这个奇怪的警告
这是我的方法
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo
atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type
{
switch (type) {
case NSFetchedResultsChangeInsert:
[stampsTableView insertSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
break;
case NSFetchedResultsChangeDelete:
[stampsTableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
break;
}
}
-(void)控制器:(NSFetchedResultsController*)控制器didChangeSection:(id)sectionInfo
atIndex:(nsInteger)ChangeType:(NSFetchedResultsChangeType)类型的节索引
{
开关(类型){
案例NSFetchedResultsChangesInsert:
[StampTableView insertSections:[NSIndexSet IndexSetWithiIndex:sectionIndex]带行动画:UITableViewRowAnimationFade];
打破
案例NSFetchedResultsChangeDelete:
[StampTableView deleteSections:[NSIndexSet IndexBethIndex:sectionIndex]和RowAnimation:UITableViewRowAnimationFade];
打破
}
}
警告如下图所示。如何解决警告
添加默认值以处理其他情况
switch (type) {
case NSFetchedResultsChangeInsert:
break;
case NSFetchedResultsChangeDelete:
break;
default:
break;
}
添加默认值以处理其他情况
switch (type) {
case NSFetchedResultsChangeInsert:
break;
case NSFetchedResultsChangeDelete:
break;
default:
break;
}