Help with My First Xcode Application

Discussion in 'Mac Programming' started by Cheetah777, Jan 8, 2010.

  1. Cheetah777 macrumors newbie

    Cheetah777

    Joined:
    Jan 8, 2010
    #1
    I am just started my Cocoa programming education. I have mostly a non-object-oriented programming background. I do have a little C++ education. I am using OS X 6.1.2, XCode 3.2.1 and getting started in Aaron Hilligass' Cocoa Programming For Mac OS X. I am using the Second Edition of the book (which I know is not the book for my Xcode release) and need a little help on the first programming exercise in Chapter 1. I followed all the instructions and everything looked pretty much the same as the example. However, when I Build & Run the application it does not generate any output. I suspect I am having problems with the part where I am dragging the object that will handle the outputted text. In the Second Edition the author references "dragging a text field named System Font Text" from the system palette and placing it on the blank window. In Xcode 3.2.1 I don't see anything that is similar to this. Any ideas on what to check would be greatly appreciated. Thanks.
     
  2. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    "System Font Text" was just the default text that gets shown in a new text field (so you can see it while placing it, since it used to have no border initially). You just want to look for an NSTextField object. The newer Interface Builder has a search field on the Library palette that you can use to narrow down the clutter.
     
  3. Cheetah777 thread starter macrumors newbie

    Cheetah777

    Joined:
    Jan 8, 2010
    #3
    First App Now Working

    After talking to a friend of mine who is familiar with Cocoa application development, I can see a very clear reason to upgrade to the latest edition of "Cocoa Programming for Mac OS X." There were a number of significant changes made to Interface Builder and Xcode for the Snow Leopard upgrade and the next edition seems to follow the Snow Leopard version pretty well. I made two changes to my application to get it working. First, in the Library Window of Interface Builder I deleted the previously defined Outlet and added a new one with Type set to NSTextField to my textField object. Second, I did not realize that the connection making process had directionality. I right clicked on the Foo instance in my MainMenu.xib window. I then hovered over the Outlet radio button and when it changed to a "+" sign I clicked and drug to the textField output field. After I made those two changes I clicked on Build & Run and the application worked just fine.
     

Share This Page