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

alexcurtis

macrumors newbie
Original poster
Jun 11, 2010
9
0
Hi,

I have a problem creating and launching a NSPanel from a NSWindowController.

In The NSWindowController (EditCountdownController: init)
Code:
self = [super initWithWindowNibName:@"EditCountdown"];
return self;


In The Main Window Controller (This Creates The Window Controller Object etc)
Code:
 if(!m_edit_controller)
  {
    m_edit_controller = [[EditCountdownController alloc] init];
  }
 
  [m_edit_controller showWindow:self];

Now if i turn off "Visible at launch" in interface builder, the panel doesnt show up at all. If its switched on it turns up on the correct event, but if i close the panel (using x at top) and try and reopen it doesnt show.

Many Thanks,
-Alex
 

Sydde

macrumors 68030
Aug 17, 2009
2,552
7,050
IOKWARDI
I have never worked with window controllers before, is there a particular need or advantage for doing this vs. just communicating directly with the panel?
 

alexcurtis

macrumors newbie
Original poster
Jun 11, 2010
9
0
I have never worked with window controllers before, is there a particular need or advantage for doing this vs. just communicating directly with the panel?

Ideally I would like to use a controller because of its reuse properties and this application is going to grow to a substantial size.

Many Thanks,
-Alex
 

alexcurtis

macrumors newbie
Original poster
Jun 11, 2010
9
0
Ok. I worked it out.

I forgot to link the window referencing outlet (in the NSPanel) to the Fileowner (The Controller)

Cheers,
-Alex
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.