*** Assertion failure in -[UITableView_endCellAnimationsWithContext:],/SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:1070
libc++abi.dylib: handler threw exception
-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView{
return [_arrKeys count];// _arrKeys中存放分组
}
-(NSInteger)tableView:(UITableView *)tableViewnumberOfRowsInSection:(NSInteger)section{
NSString* _date = [_arrKeys objectAtIndex:section];
NSArray* _notifications = [_dictData objectForKey:_date];//_dictData存放数据
return [_notifications count];
}
-(void)tableView:(UITableView *)tableViewcommitEditingStyle:(UITableViewCellEditingStyle)editingStyleforRowAtIndexPath:(NSIndexPath*)indexPath
{
if(editingStyle ==UITableViewCellEditingStyleDelete){
[selfrefreshData];//刷新_arrKeys和_dictData中的数据
int newCount=0;
if(indexPath.section<[_arrKeys count]) {
NSString *_date = [_arrKeys objectAtIndex:indexPath.section];
NSArray* _notifications =[_dictData objectForKey:_date];// _dictData存放数据
newCount=[_notifications count];
}
[tableView beginUpdates];
if(newCount<=0) {
[tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationLeft];
}
[tableViewdeleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft];
[tableView endUpdates];
}
elseif (editingStyle ==UITableViewCellEditingStyleInsert){
//修改时
}
}