推 Piceman:Uodate datasource before reload row 11/04 15:04
我有一個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