3 つの UITextFields と UIButton を持つ songInfoView というビューがあります。親ビューに一時 UITextField を作成してキーボードを表示し、songInfoView を inputAccessoryView として割り当てます。これは期待どおりに機能します。
次に、songInfoView にファーストレスポンダとしてテキスト フィールドを設定してみます。カーソルがこのフィールドに移動しますが、入力しようとしても何も起こりません。テキストフィールドをタップして期待どおりに入力できますが、タップしなくても機能するようにしたいです。何か不足していますか?私はこれを順不同でやっていますか?ご協力いただきありがとうございます。
songInfoView = [[SongInfoViewController alloc]init];
songInfoView.delegate = self;
UITextField *tempTextField = [[UITextField alloc]initWithFrame:CGRectMake(10.0f, 10.0f, 50.0f, 30.0f)];
[self.view addSubview:tempTextField];
[tempTextField setInputAccessoryView:songInfoView.view];
[tempTextField becomeFirstResponder];
[songInfoView.titleTextField becomeFirstResponder];