How do I set the firstresponder?

后端 未结 3 1980
无人及你
无人及你 2021-02-18 22:59

I have a view built through IB, there\'s a text view and and button on it. When the view shows up I would like to have the keyboard to be already displayed.

I tried to s

3条回答
  •  粉色の甜心
    2021-02-18 23:29

    Looks like you may have accidentally misspelled the method name didViewLoad instead of viewDidLoad. All you should need there (assuming your IBOutlet is connected in IB) is the following:

    [textView becomeFirstResponder];
    

提交回复
热议问题