我正在閱讀一些教程,用於編輯其數據存儲在服務器中的表格單元格。一切工作正常 - 我可以編輯表格單元格,然後單擊「保存」按鈕,但如果我回到表格概述,它不會更新。 我有3表中的字段:單元格數據不更新
- titleField
- authorField
- atextField
我不知道,如果問題來自於這一段代碼,但我想是這樣。本教程例子中只有2場,我需要3場,但我不知道如何實現這段代碼3個文本框:
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
if (textField == titleField) {
[authorField becomeFirstResponder];
}
if (titleField == authorField) {
[self save];
}
return YES;
}
我已經嘗試過if (titleField == authorField == atextField)
,但錯誤信息說:Comparison between pointer and integer ('int' and 'UITextField')
。我也嘗試過if (titleField == authorField && titleField == atextField && authorField == atextField){
,我沒有收到錯誤,但它並沒有改變數據不會更新更改的事實。
上面的代碼應該如何顯示?
謝謝,我明白你的意思了!不幸的是,它仍然不能解決我的問題。所以這個問題可能是我想的其他地方。不管怎麼說,多謝拉。 – Kirinriki