So, this question follows from the previous problem , but I decided to publish a new question in order to maintain relevance and order.
Basically, when the following code snippet is called, there is no difference between UITableViewRowAnimationFade and UITableViewRowAnimationNone :
- (void) setEditing:(BOOL)editing animated:(BOOL)animated { [tvController.tableView beginUpdates]; if (editing == YES) { [tvController.tableView deleteRowsAtIndexPaths:[settingsArray objectAtIndex:0] withRowAnimation:UITableViewRowAnimationFade]; }else { UITableViewRowAnimation animation = animated ? UITableViewRowAnimationFade : UITableViewRowAnimationNone; [tvController.tableView reloadRowsAtIndexPaths:[settingsArray objectAtIndex:0] withRowAnimation:animation]; [tvController.tableView reloadSectionIndexTitles]; self.navigationItem.hidesBackButton = editing; } [tvController.tableView endUpdates]; }
I really appreciate any help. It still enters editing mode, but does not animate it, depsite YES is transferred to animated.
EDIT: The animation works fine when I actually delete everything using the following code:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { NSString* documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *stuff = [documentsPath stringByAppendingPathComponent:@"stuff.plist"]; BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:stuff]; if (fileExists) { NSMutableDictionary *propertyList = [[NSMutableDictionary alloc] initWithContentsOfFile:enteredPlaces]; [propertyList removeObjectForKey:[[settingsArray objectAtIndex:1] objectAtIndex:indexPath.row]]; [propertyList writeToFile:stuff atomically:YES]; } [[settingsArray objectAtIndex:1] removeObjectAtIndex:indexPath.row]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft]; } }
It just does not work, when the user presses the edit button, and the table goes into edit mode, tableview is simply statically put into edit mode.
source share