[問題] reloadRowsAtIndexPath exception

看板MacDev作者 (Unknown)時間11年前 (2013/11/04 14:29), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/4 (看更多)
我有一個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

11/04 15:04, , 1F
Uodate datasource before reload row
11/04 15:04, 1F
文章代碼(AID): #1ITpwv6p (MacDev)
文章代碼(AID): #1ITpwv6p (MacDev)