Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Problem in Chapter 4 (Control Fun project)

Am having a problem with the "Control Fun" project. 

Have gotten up to page 91, where I have imported the Apress graphic, configured the two text fields and two labels, and the two IBOutlet properties. Then when I ran the app in iOS Simulator, and tried to click in the text field, the cursor wouldn't appear and the keyboard didn't pop up.

I have done this twice, with the same results. What's wrong?


  • Have you resolved this yet? I had the same problem, but after ages trying I realised I'd put the wrong control into the view – I think it was a button, which looked almost the same. Don't know whether that will help.
  • There's an important distinction between UILabel, which is used just for displaying (not editing) text, and UITextField, which lets the user edit text as well. On the Mac, NSTextField takes both of these roles, but they are separate classes on iOS. Maybe you dragged out labels instead of textfields?
  • Had the same problem right now. Soo frustrating: just a few klicks and nothing works - and you didn't find out why. I wonder how to find problems in real (i.e. larger) programs...

    Tried it a second time and it worked fine.

    (and yes, I used a text field)
  • These kind of things can be really frustrating, especially when it's a detail tucked away in a nib file! It's one thing to look at a source code listing and try to spot problems in the code, but quite another to guess about the content of a nib file.

    For what it's worth, if you come across problems like this, feel free to pass along your problem nib, or even better your entire project. Either upload somewhere and give us a link on the forum, or just email it to me. You might be surprised how much time I spend helping people with their projects even when they're NOT related to a book problem :)
  • Xcode is not perfect.  I had the same problem with the UITextField, along with the order and placement of the labels and fields.  When I ran the simulator they did not appear in the order of what was showing in the .xib file.  Getting out of Xcode and the Simulator completely, then entering one text field got the keyboard to show up in the simulator.  
Sign In or Register to comment.