On an iPad with iOS 6 GM. I have 6 UITextFields, 3 UITextViews, and a UIButton that triggers a popover/actionsheet.
When I select one of the UITextFields or UITextVie
Try becomeFirstResponder in dispatch_async(dispatch_get_main_queue(),^{});
I ran into this same issue, make sure that the app delegate has a [self.window makeKeyAndVisible]
. That solved it for me.
For me your solution doesn't work so I found another.
I'm using Revmob Ads so fullscreen view and banner view are loading when app is launched. Revmob uses some staff for displaying same banner in all viewcontrollers I think here is issue. When I disabled revmob I can add text to my textfield.
To clarify other answers, you can not input text to a window that is not set to be the key window. Most applications only use one window, or don't have text input on additional windows so never encounter this problem.
When handling multiple windows make sure to resignKeyWindow
+makeKeyWindow
while switching the focus and, very important, to restore the key window afterwards!
These solutions didn't work for me, but after I deleted the derived data folder at ~/Library/Developer/Xcode/DerivedData/AppName
, it worked.
This was originally an iPhone app built on iOS 5. To make it an iPad app, I just duplicated the project and upgraded all the .xibs
to iPad versions. I don't know if it's a bug or not, or if it's something to do with the upgrade to iOS 6, but doing it like that messes something up with the MainWindow.xib
.
In the MainWindow xib, I typed in "MainViewController"
for the title (It was previously blank.)
And checked off "Visible at Launch"
. Even though it is already visible at launch, not having that checked off screws something up.
Now all my text views and text fields work.