0

I have an application that allows the user to edit multiple text fields and views. Rather than mess around raising each view to the top when the keyboard is active, I decided to instead make one textView for editing and hide/show it when input is needed, then transfer the data when it is done. To move focus to the new textView, I call its becomeFirstResponder method, and lo and behold, the cursor goes to the right place. However if I use this method, the iPhone keyboard does not appear. I have no idea why. Can anyone explain, and tell me how to make the keyboard appear? All the other questions I've looked at seem to indicate that setting becomeFirstResponder for a textView ought to make the keyboard come up.

-Ash

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
Ash
  • 9,064
  • 3
  • 48
  • 59
  • 1
    Do you have a bluetooth keyboard hooked up? – Eiko Aug 21 '10 at 08:54
  • No, I'm running in the simulator. – Ash Aug 21 '10 at 09:01
  • I'm pretty curious to see this interface. This sounds like a really novel approach. – Dan Ray Aug 26 '10 at 12:28
  • In the end I abandoned it as an unnecessary embuggerance upon my coding time and went back to simply shifting the data fields up out of the way of the keyboard :) The code can be made to work I'm sure, but I was probably implementing it in the wrong place: textViewDidBeginEditing. In retrospect, it might have worked if I'd placed it somewhere like textViewWillBeginEditing (assuming such a method exists within the protocol) since it wouldn't be conflicting with the textView's own wishes. I might try this again sometime, but now my code is working I don't want to mess with it. – Ash Aug 26 '10 at 14:42

2 Answers2

1

Is Hardware -> Simulate Hardware Keyboard enabled?

Ole Begemann
  • 135,006
  • 31
  • 278
  • 256
  • Yep. However, I think I found out what the problem was. I was attempting to set the delegate within a routine that somehow denied the setting of a delegate, namely textViewDidBeginEditing – Ash Aug 22 '10 at 12:05
1

Are you doing this whole thing programatically or using Interface Builder as well? If so are the IB connections setup right?

Zigglzworth
  • 6,645
  • 9
  • 68
  • 107
  • Yep, otherwise it wouldn't have performed the other tasks within the same code block. However, I think I found out what the problem was. I was attempting to set the delegate within a routine that somehow denied the setting of a delegate, namely textViewDidBeginEditing – Ash Aug 22 '10 at 12:06