1

My app works as supposed on an iPhone running iOS 4.1 but not on iOS 4.2. I have an UIInputField set to first responder but the keyboard does not show up. The becomeFirstResponder is called in the viewDidLoad method. Is it a bug or has Apple made drastic changes? I'm using Xcode 3.2.5.

KingofBliss
  • 15,055
  • 6
  • 50
  • 72
AOO
  • 321
  • 1
  • 4
  • 10

3 Answers3

2

Does the input field have User Interaction Enabled? This is now required in iOS 4.2.

  • 1
    by required I mean in prior versions, becomeFirstResponder would work with this disabled....apparently this changed in iOS 4.2 – Steve Smith Dec 01 '10 at 02:53
1

-viewDidLoad is called when your view is first initialized, not necessarily when it's displayed. Try calling -becomeFirstResponder inside -viewDidAppear: instead:

 - (void)viewDidAppear:(BOOL)animated {
     [super viewDidAppear:animated];

     [myField becomeFirstResponder];
 }
Justin Spahr-Summers
  • 16,893
  • 2
  • 61
  • 79
0

Found a thread at the Apple Developer Forums (https://devforums.apple.com/message/325348#325348) where a solution was described. Set the UITextField property userInteractionEnabled to YES before a call to becomeFirstResponder is made, preferably in the viewDidLoad method.

AOO
  • 1