5

I have a UITextField which is being set as first responder, and I have verified afterwards that it has been set as the first responder, and the keyboard pops up as well.

However when I try to type on the keyboard nothing is entered into it, and furthermore the keys do not light up either.

A really strange thing is when I plug in a bluetooth physical keyboard I am able to enter in characters in the field! Then when I shut off my keyboard and the virtual keyboard comes up again I cannot type.

I've searched around the internet for solutions for this but no avail. I am calling makeKeyAndVisible for my UIWindow which was a suggested solution by someone.

Aleksander Azizi
  • 9,829
  • 9
  • 59
  • 87
Locksleyu
  • 5,192
  • 8
  • 52
  • 77
  • 1
    You should provide some more details... – race_carr May 05 '14 at 03:31
  • when connect with bluetooth, are you set other devices as inputs like scanner etc... – Vineesh TP May 05 '14 at 03:57
  • Check this - **http://stackoverflow.com/questions/12447875/keyboard-and-cursor-show-but-i-cant-type-inside-uitextfields-and-uitextviews** and **http://stackoverflow.com/questions/19196609/uitextfield-in-ios7-simulator-do-not-take-any-input-from-mac-keyboard** – Kumar KL May 05 '14 at 07:16
  • race_carr - let me know specifically what details you need. – Locksleyu May 05 '14 at 21:57
  • Vaineesh TP - I am not using any other bluetooth devices. – Locksleyu May 05 '14 at 21:57
  • Kumar KL - Thanks for the two links. I have read the first and tried many of the things suggested but no luck. The second link refers to the simulator which I am not using. – Locksleyu May 05 '14 at 21:57
  • If you provide demo project were this issue is reproduced it would be easier to understand what is wrong. I could only suggest that the window where textField is placed isn't key (in terms of UIWindow: key and visible). – Vlad Papko May 06 '14 at 21:20
  • I think you need to provide your code. Do you create the `UITextField` programatically? If not, have you tried deleting the `UITextField` from the view and adding a new one? – Aleksander Azizi May 08 '14 at 06:02
  • just in case you are missing something like the delegate: yourTextField.delegate = self; and that the delegate protocol for textfiled is called in your viewController... – Alice May 09 '14 at 01:07
  • Make sure that app is not freezing first.. – Sathish Kumar May 09 '14 at 11:39

4 Answers4

4

I had a similar issue. My problem was the main view frame of the key window is smaller than the window bounds, so the virtual keyboard was actually outside the main view frame. Tapping on the virtual keyboard does absolutely nothing.

What I would do: 1. Check for the frame for the main view of the key window. 2. Check whether root view controller is assigned to the key window.

I had this issue on an old codebase for an iPad application which had no root view controller for the main window and thus would not resize properly after rotating.

It might be worth checking out.

Sani
  • 1,283
  • 11
  • 30
1

First thing you can try is to press the command key by itself, release it and then start typing. Sometimes this can enable the keyboard in the simulator.

If the previous step failed, If you are using a simulator, sometimes there will be issues with the keyboard. To verify it is not your code, run on an actual device and test.

If it works on the device, then clean the project, reset the simulator, close the simulator, restart XCode, try again.

If the problem persists, do the same steps above, but reset the computer before starting up XCode again.

William Falcon
  • 9,813
  • 14
  • 67
  • 110
  • I am only testing on the live device and there is a separate part of my code which doesn't work well with the simulator (not going to go into that since it isn't relevant here). I've tried resetting the computer and XCode but no luck. – Locksleyu May 05 '14 at 21:55
1

Your keyboard is not receiving touch events.There are multiple reasons for this to happen to a view. some are

  1. An invisible view is in front of the keyboard and consuming the touch events. A good tool to see if this is the case is spark inspector (has a free trail) which shows you all the view in your app from different angles to spot unexpected behaviour.

  2. The keyboard some how has user interaction disabled. If you set your current parent view to user interaction enabled just before your code brings up the keyboard it would help you rule out these possibilities.

Martin O'Shea
  • 432
  • 5
  • 15
0

You should reset the iOSSimulator, its contents and settings and quit and relaunched the iOS-simulator. it worked.

This exactly happened when u updated the code from SVN. clean the code, relaunch the simulator when ever updating the source code from SVN especially with Xcode5.

László Papp
  • 51,870
  • 39
  • 111
  • 135