How to create IBOutlet NSButton interface builder

Discussion in 'Mac Programming' started by dbrayford, Sep 27, 2010.

  1. macrumors member

    Joined:
    Feb 22, 2010
    #1
    I am trying to add a button to an existing window that already contains a button using interface builder. However, I can't get a handle to the new button in the code.

    Existing code
    Code:
    @interface MyFooGLView : NSOpenGLView
    {
    	IBOutlet NSButton *SelectSurf0;
    }
    
    I want to be able to add, but don't know how to add a reference to the new button and name it MyButton.
    Code:
    IBOutlet NSButton *MyButton;
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Add the definition to the interface after the existing one. Have IB resync with the file.
     
  3. thread starter macrumors member

    Joined:
    Feb 22, 2010
    #3
    Thanks, I did that and restarted x-code and interface builder and it was there.
     

Share This Page