作者peliuya (Unknown)
看板MacDev
标题[问题] reloadRowsAtIndexPath exception
时间Mon Nov 4 14:29:11 2013
我有一个custom cell内包含了一个textField,
我希望在该textField编辑结束後, 单独更新该Cell
以下是我的程式码, 在编辑结束时
- (BOOL) textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
return YES;
}
- (BOOL) textFieldShouldEndEditing:(UITextField *)textField
{
NSIndexPath *AlertPath = [NSIndexPath indexPathForRow:1 inSection:0];
NSArray *myArray = [NSArray arrayWithObjects:AlertPath, nil];
[self.functionTable reloadRowsAtIndexPaths:myArray
withRowAnimation:UITableViewRowAnimationAutomatic];
return YES;
}
在执行到 reloadRowsAtIndexPaths 後 产生了一个exception
Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Attempt to delete row containing first responder
that refused to resign'
若以 [self.functionTable reloadData] 来更新则是没有问题的
请问我该如何解决这个问题呢?
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 60.251.44.30
1F:推 Piceman:Uodate datasource before reload row 11/04 15:04