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

alexcurtis

macrumors newbie
Original poster
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
 
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?
 
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
 
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.