6

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!

Ron
  • 1,047
  • 13
  • 18
  • show us the code how u r making first responder for textfields which r not working.. – vishy Sep 25 '12 at 15:13
  • By setting: [ratingText becomeFirstResponder]; or by clicking on the textfield or textview added with Interface Builder. And to clarify, all outlets are properly connected as it IS working on iOS 5. – Ron Sep 25 '12 at 15:17

2 Answers2

3

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...

Ron
  • 1,047
  • 13
  • 18
2

I know this post is old, but if it help, in iOS6 yo also need to resign the responder in the "granparents" views.

Ex:

Search View (don't resign responder) -> Detail View -> Super Detail View (This one have the problem).

Detail View dont have first reponder, but Search View has it.

We have to resign the responder in Search view to solve the problem in Super Detail View.

I assume that we also have to resign responder in the previws controllers of Search View.

Vertig0
  • 623
  • 3
  • 15