Reputation: 115
How can I show the keyboard when my popover shows up?
The popover is UIViewController that I call from a popoverController.
The popover has an UITextField and when the popover is displayed, the keyboard need to show up too and the cursor go to the UITextfield.
I tried to put the becomeFirstResponder under viewDidLoad or viewWillLoad, and not work.
[userValue becomeFirstResponder];
What I miss? That's all folks. Thanks.
Upvotes: 0
Views: 741
Reputation: 1501
i think u didn't set the textfield delegates to self and trying putting breakpoints and check what is happening ,is it even going to textfield delegates or not.
Upvotes: 0
Reputation: 4634
You need to make the textField the first responder, not the popover itself. Just because you make an object the first responder, doesn't mean it will show the keyboard. It needs to be an object with text entry properties, like a UITextField, to display the keyboard.
- (void)viewDidAppear:(BOOL)animated{
[_textField becomeFirstResponder];
[super viewDidAppear:animated];
}
You can call the method above if you want that particular textField to be the first responder, with keyboard, each time the popover is displayed. Remember, this method is called AFTER the popover is loaded.
Hope this helps.
Upvotes: 1