Problem with Interface Builder (simple problem)

Discussion in 'Mac Programming' started by Muncher, Jun 3, 2008.

  1. Muncher macrumors 65816

    Muncher

    Joined:
    Apr 19, 2007
    Location:
    California
    #1
    I've been trying for a while to get the example at this website running. I've gotten up to the part where it tells me to "drag the AppController.h file to the nib document window in Interface Builder." I drag it, when my mouse is hovering over the Document window a green plus appears. Then I drop it, and nothing happens. The file is a header with a perfectly valid class that builds fine.

    What am I doing wrong?!!

    Contents of file:
    Code:
    #import <Cocoa/Cocoa.h>
    
    @interface AppController : NSObject {
    	IBOutlet id textView;
    }
    
    - (IBAction) clearText: sender;
    
    @end
    
     
  2. wlh99 macrumors 6502

    Joined:
    Feb 7, 2008
    #2
    I think the problem is that you are using Xcode 3.x, and the example is for Xcode 2.5. I have been fighting the same issues, some examples are for 2.5, and others from 3.x.

    Try this (from memory, I'm at work so I may be wrong) From one of the menu's select "read class file" and read your .h file. Then drag an NSObject from the library to the Document window. It should let you do that. Then open the inspector, and change the object type to AppController.

    There is a tutorial where you build a CurrencyConverter that is for Xcode 3.x. It's a good place to start if you are having the same problems as me.
     
  3. Muncher thread starter macrumors 65816

    Muncher

    Joined:
    Apr 19, 2007
    Location:
    California
    #3
    Haha! It works! Thank you so much for the quick response. I finished up the tutorial, I think I get it now!
     

Share This Page