My iPhone app (based on the "Single View Application" of Xcode) has a UITextView (say: myTextView) that I want the user to be able to edit. I was setting it to editable, and all was working fine (I didn't even have to invoke becomeFirstResponder).
Then I moved it in another UIWindow (say: newWindow) (on top of the main/root/key one that is called self.window (of the Single View App.)).
But now, when I click on the UITextView, the keyboard does not show.
Everything works if I do this:
[myTextView setEditable:YES];
[myTextView becomeFirstResponder]; // ugly...and I do not need it, but I added it just in case...
[self.window addSubview:newWindow];
but the keyboard is shown immediately (since I set becomeFirstResponder) that is not nice. But if I remove the becomeFirstResponder line, the keyboard does not show at all!
If I move the [self.window addSubview:newWindow] line above, then no matter what I do, the keyboard is not activated...
[self.window addSubview:newWindow]; // this is how it should be... but,
[myTextView setEditable:YES];
[myTextView becomeFirstResponder]; // even when I enter this, it's not working :-(
I tried [newWindow makeKeyAndVisible] nothing. I tried to add a touch delegate and detect a touch (or a gesture) on the UITextView, they work (I get the NSLog message I included), but again, no keyboard. I even tried to add another field (of the main window) on top of newWindow (so as to have a main window element on top), still no luck...
What am I missing?