UITableView reload sections crashes

747 Views Asked by At

I'm using [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:k] withRowAnimation:UITableViewRowAnimationNone];, I examined I'm getting a valid value for k but still I'm getting -[NSIndexSet initWithIndexesInRange:]: Range {9223372036854775807, 1} exceeds maximum index value of NSNotFound - 1.

1

There are 1 best solutions below

2
Amit Jagesha シ On

Try following code it may help you

NSRange range = NSMakeRange(0, 1);
NSIndexSet *section = [NSIndexSet indexSetWithIndexesInRange:range];                                     
[self.tableView reloadSections:section withRowAnimation:UITableViewRowAnimationNone];