Hallo again!
Thank you for your help! I really found a solution for my problem!
I no longer need tableview animations while editing! I finally found a solution in this post: How to stop the UITableView moveRowAtIndexPath from leaving blank lines when reordering
Tom Saxton said:
// APPLE_BUG: if you move the cell to a line that is off the screen (because the destination // has been changed), the dummy cell is created and will eventually crash
So my code looks like this:
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
if( fromIndexPath == toIndexPath ) {
return;
}
if (toIndexPath.row == [self.data count] -1) {
self.data removeObjectAtIndex:fromIndexPath.row];
[self performSelector:@selector(delayedReloadData:) withObject:tableView afterDelay:0];
}
else {
[self.data removeObjectAtIndex:fromIndexPath.row];
[self.data insertObject:element atIndex:toIndexPath.row];
}
}
- (void)delayedReloadData:(UITableView *)tableView {
[self.tableView reloadData];
}
mem initData, :
-(void) initData {
if (!self.data) {
self.data = [[NSMutableArray alloc] init];
}
else {
[self.data removeAllObjects];
}
[self.data addObjectsFromArray:[self.fetchedResultsController fetchedObjects]];
}
!