Hi,
I have a table view that manages a list of objects, stored in a property self.equations. I have a button that pulls up an action sheet, which then clears the self.equations array and the table view.
Code:
-(void)clearEquations:(id)sender
{
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:@"Clear"
otherButtonTitles:nil];
actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
[actionSheet showInView:self.view];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
[actionSheet dismissWithClickedButtonIndex:buttonIndex animated:YES];
if (buttonIndex == 0)
{
[self.equations removeAllObjects];
[self refreshEquations];
NSMutableArray *indexPaths = [NSMutableArray array];
for (int i = 0; i < [equationLayers count]; i++)
[indexPaths addObject:[NSIndexPath indexPathForRow:i inSection:0]];
[tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationRight];
if (self.delegate != nil)
[self.delegate editedEquations:self.equations];
}
}
The code runs fine if I use [tableView reloadData] instead of [tableView deleteRowsAtIndexPaths:withRowAnimation], but I'd like the row deletion to be animated. This code gives SIGABRT and in the console, it says:
Code:
*** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1912.3/UITableView.m:1046
What does the warning mean, and how can I get around it?
Thanks!