I have in a view this method
- (void)viewWillAppear:(BOOL)animated{
[textField1 becomeFirstResponder];}
then when I open this view I have my keyboard ready to write in textField1, and it’s all right.
but when I show a simply alert view
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ok!"
message:@"It's all right"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
when I press “ok” in alert view my keyboard disappears and reappears after automatically. Why I have this effect? Can I leave this effect?
Try implementing UITextFieldDelegate’s method
Example implementation: