I have some pretty complicated rules for moving lines around UITableView. There is an undefined number of sections and lines in each section and based on different rules, lines can be moved inside or between user sections in certain other places.
All data updates and everything works. But sometimes, after moving the line, the application will be a wig, and suddenly an empty place appears where the line should be displayed.
I use:
- (NSIndexPath *)tableView:(UITableView *)tableView
targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath
to indicate where the user is allowed to drag rows based on where the cell is located. 98% of the time it works. But in some cases, when the user is allowed to move between sections (it is impossible to change the order of the lines in the section), this error appears, after which the application is reset after scrolling through the area without a line.
The exception thrown is pretty useless:
Application termination due to an uncaught exception "NSRangeException", reason: "*** - [NSCFArray objectAtIndex:]: index (6) outside (6)
None of my codes are on the stack. The last method specific to UITableView is
-[UITableView(UITableViewInternal) _visibleCellForGlobalRow:]
Has anyone seen this problem before? Any ideas?
source
share