views:

2071

answers:

2

I'm currently developing an OpenGL ES game for the iPhone and iPod touch.

I was wondering how I can easily pull up the UIKeyboard? Is there an official, documented possibility to pull up a UIKeyboard without using a UITextField of UITextView?

A: 

I haven't tried it but http://www.cocoadev.com/index.pl?UIKeyboard shows some code that looks like it should work.

Amuck
I don't think UIKeyboard is officially exposed in the SDK, so perhaps to be "legal" you have to use a hidden UITextField.
David Maymudes
@David - So it's not possible then?
Kriem
+3  A: 

It's not "officially" possible - you can't access the UIKeyboard object at all while staying within Apple's guidelines.

Creating an invisible UITextField, then calling [textField becomeFirstResponder] would do the job - you could even subclass UITextField first, then override the delegate method textField:shouldChangeCharactersInRange: to redirect the text input to where you want it to go.

Tim