Ib 3

Discussion in 'Mac Programming' started by garethlewis2, Oct 29, 2007.

  1. garethlewis2 macrumors 6502

    Dec 6, 2006
    Simple scenario, single document interface program. Not MDI.

    IB 2, you create the class Contoller by subclassing NSObject in the Classes tab.

    IB 3. There is no classes tab, so you can't create the controller class that way anymore. How are you supposed to do this now?
  2. eulerthegrape macrumors newbie

    Oct 29, 2007
    Analog to the built in tutorial

    I am a total n00b and ran into a similar issue to the OP. Apple issued the "Xcode Quick Tour Guide" with Xcode 3.0 but, seemingly, uses Interface builder 2.0. I'm trying to mindlessly follow the tutorial to create a hello world app but quickly hit a wall. It won't let me drag the object icon and change its type.

    They say to:

    1. Open MainMenu.nib in Interface Builder
    2. Create the HelloView class:
    a. In the MainMenu.nib window, click Classes.​
    b. in the tree view, select NSObject > NSResponder > NSView.​
    c. Choose Classes > Subclass NSView.​
    d. Change MyView to HelloView and press Return.​
    e. choose Classes > Create Files for HelloView.​


    1. is their an updated tutorial somewhere that uses InterfaceBuilder 3 or can someone with the tutorial take a look and show me how to implement this program with the new InterfaceBuilder. I would really appreciate any help as I was really excited about trying out Xcode and I'd hate to stop now before I got started.

  3. kainjow Moderator emeritus


    Jun 15, 2000
    In Interface Builder 3, try:

    1. In the Library window (Tools > Library), select Library > Cocoa, then scroll to Custom View (second to last row).
    2. Drag the icon for Custom View into your nib, alongside File's Owner, First Responder, Application and MainMenu.
    3. Select your view, go to the Identity Inspector (Tools > Identity Inspector), and change the Class from NSView to HelloView.
    4. Choose File > Write Class Files...
  4. eulerthegrape macrumors newbie

    Oct 29, 2007
    Building in Xcode issue

    OK, that was very helpful I think the key there is where to add the new custom type (alongside the File's Owner, First Responder etc.). Now I added a Custom View to the window and changed it's type to HelloView. I added these files to my Xcode project (is there another way to do this than going into finder and pulling the HelloView.h and .m files over?) but when I opened the files the .m file it was empty and the project would not compile. Sorry if this is trivial.
  5. garethlewis2 thread starter macrumors 6502

    Dec 6, 2006
    Got it working.

    Completely different to previous versions of IB.

    Next month I am going to be slapping down $500 to get ADC select then find every single piece of information there is on Leopard development.

    It does make sense now, but it is confusing. I had to create the ConverterController class and Converter class in XCode, basically empty. Then drag both header files along to IB3 so when I added the two NSObjects, I could select the type they were. That is going to cause a lot of headaches with developers used to XCode 2.
  6. kainjow Moderator emeritus


    Jun 15, 2000
    I don't know if you'll need to do that now. It seems like they are opening up more of the articles and documentation to the public and I'm sure in a month's time there will be even more available. But if you're going to WWDC 08 it's worth it :D
  7. benuaq macrumors newbie

    Mar 3, 2008
    Sorry for replying on such an old/dead thread, but I'm having real trouble with this.

    I've been following this tutorial:

    I've got to section 12, "Add Header to NIB"
    I follow the suggestions you guys have made, about making a new Custom View and dragging across the .h file

    I can't tell if anything has happened after dragging the file across, as nothing seems to change.

    If I change the "Class" section of my new Custom View to the class AppController, it makes the error sound and goes back to being blank.

    I would really appreciate any help, I've been writing mac apps for almost 2 hours now, I'm such a noob xD

Share This Page