Question

I have a requirement where I have a textfield in a view. When I want to open the view by switching the tab (TabBased Application), first time when the view is loaded the keyboard appears because i loadview method is called. But when I switch to tab2 and again switch to tab1 again, load view is not called. I want the keyboard to appear every time I open the tab1 page.

Was it helpful?

Solution

Use -viewWillAppear: in your view controller to send your text field a -becomeFirstResponder message, e.g.:

- (void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [myTextField becomeFirstResponder];
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top