Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some UITextfields don't respond in iOs6

Since updating to iOS 6 I have this weirdest bug when trying to make an UITextField or UITextView firstResponder.

...it doesn't work.

I am not able to select the field or view and bring up the keyboard, nor is there a cursor or anything. The weirdest thing is that it is only not working for SOME fields, other ones in different viewcontrollers work without trouble.

I have:

[self.window makeKeyAndVisible];
self.window.rootViewController = self.viewController;

in my appDelegate. It worked and still works without problems with iOS 5.

Any ideas on what it could be?

Thanks!

like image 634
Ron Avatar asked Sep 25 '12 14:09

Ron


1 Answers

I found out what was causing the problem. From the viewcontroller I present the new viewcontroller from a textfield was firstResponder. So when I cancel this by calling

[textview resignFirstResponder]; 

or

[self.view endEditing:YES];

BEFORE presenting the new viewcontroller, it works without problems. Question remains.... Why is this? And is there a better way to overcome this? I don't feel much for resigning every textfield throughout my app...

like image 163
Ron Avatar answered Sep 17 '22 13:09

Ron