Opening NSWindow twice

Discussion in 'Mac Programming' started by hatim, Jul 9, 2008.

  1. hatim macrumors newbie

    Jul 9, 2008
    Hi There I am new to XCode 3.0. I am trying to get my head around opening a window more than once is this possible? My class is an NSObject inherited class

    /* myController */

    #import <Cocoa/Cocoa.h>

    @interface myController : NSObject
    IBOutlet NSWindow *myWindow
    IBOutlet NSButton *myButtonToOpenWindow
    - (IBAction)clickButtonToopenWindow:(id)sender;

    #import "myController.h"
    @implementation myController
    - (IBAction)clickButtonToopenWindow:(id)sender
    [myWindow orderFront];

    How do I get it to open myWindow more than once when the button is clicked? Sorry if this question has already been asked before I could not find any thread for this. Thanks in advance
  2. Garrett macrumors regular

    Apr 4, 2007
    You need to have your NSWindow setup like this. :D
  3. hatim thread starter macrumors newbie

    Jul 9, 2008

    Hi Garrett,

    Thank you for your reply.

    The thing is I do have it set up like this and my window does come up but on the main window that comes up when the app starts I have the button that opens the myWindow when a button is clicked the only thing is that I need to open many instances of myWindow every time the button is clicked.

Share This Page