声明失败我是一个业余充其量,并坚持在这个错误!当然简单的东西...在 - [UITableView _endCellAnimationsWithContext:
- (void)addTapped:(id)sender {
TechToolboxDoc *newDoc = [[TechToolboxDoc alloc] initWithTitle:@"New Item" thumbImage:nil fullImage:nil];
[_itemArray addObject:newDoc];
//[self.tableView beginUpdates];
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:_itemArray.count-1 inSection:0];
NSArray *indexPaths = [NSArray arrayWithObject:indexPath];
NSLog(@"%@",indexPath);
[self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:YES];
[self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionMiddle];
[self performSegueWithIdentifier:@"MySegue" sender:self];
//[self.tableView endUpdates];
它上线打破了说
[self.tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:YES];
现在我得到了同样的错误,但断点是在endupdates而不是 – Jayrod7387 2014-09-25 15:52:05
我有和Jayrod7387一样的问题。 – livingtech 2015-04-27 14:47:13
在我的情况下,这是因为我不准确地计算/返回'numberOfRowsInSection'。 – livingtech 2015-04-27 14:51:28