I fixed the issue by adding [NSArray arrayWithObject:indexPath]
in place of timersArray
in order for that to work I had to place the [timersArray removeRowAtIndex:indexPath.row]
above the [self->tableView beginUpdates]
and at that point it worked!
Getting NSInvalidArgumentsException when deleting uitableviewcells
-
15-06-2023 - |
سؤال
I implemented the commitEditingStyle method to delete a row from my tableview. If I simply put [timersArray removeObjectAtIndex:indexPath.row]
the row deletes just fine. The only problem is that it does not animate so I tried putting this:
[self->tableView beginUpdates];
[self->tableView deleteRowsAtIndexPaths:timersArray withRowAnimation:UITableViewRowAnimationBottom];
[self->tableView endUpdates];
but when I try and delete something it brings up this:
'NSInvalidArgumentException', reason: '-[Timer row]: unrecognized selector sent to instance 0x17ed37b0'
I thought it was because the timersArray
is a NSMuttableArray and not a NSArray but that did not change anything. Can someone help me find out how to fix this? Anything will help. Thanks!
المحلول
لا تنتمي إلى StackOverflow