Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hatim

macrumors newbie
Original poster
Jul 9, 2008
2
0
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;
@end

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

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
 

Garrett

macrumors regular
Apr 4, 2007
173
0
22ce190ec690fad75485d94cb4f4426d.png

You need to have your NSWindow setup like this. :D
 

hatim

macrumors newbie
Original poster
Jul 9, 2008
2
0
22ce190ec690fad75485d94cb4f4426d.png

You need to have your NSWindow setup like this. :D


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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.