こんにちは、私は 1 つの UITextField を簡単に処理していました。たとえば、UITextField のデリゲートをビュー コントローラーに設定し、そのようなメソッドを実装します。
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
// Removes the keyboard from the screen
[self.textFieldProperty1 resignFirstResponder];
return YES;
}
しかし、UITextField が 2 つある場合はどうなるでしょうか。両方のデリゲートは引き続きビュー コントローラーになります。そして、上記の方法をどのように実装しますか?このような?
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
// Removes the keyboard from the screen
[self.textFieldProperty1 resignFirstResponder];
[self.textFieldProperty2 resignFirstResponder];
return YES;
}