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

mdeh

macrumors 6502
Original poster
Jan 3, 2009
345
2
The challenge is quite easy, I think...but there is one really puzzling aspect.

The challenge reads
Create a nib file with a custom About panel. Add an **outlet** to AppController to point the new window.
{Emphasis is mine}

The method used in AppController is this.

Code:
-(IBAction) showPanel: (id) sender
{
	BOOL successful = [NSBundle loadNibNamed: @"About" owner: self];
	// More code here to check "successful"
}

In the AboutWindow.xib I hooked up File's owner's aboutWindow outlet to the NSPanel Object (after setting File's owner to AppController). One other issue was to set the target of MainMenu's "About NewApplication" to AppController's method "showPanel".

Now, this all works as expected. But...and this is the part I do not understand, if one comments out the outlet in Appcontroller AND severs the outlet in File's owner to the NSPanel Object, it **still** works, so I am left to ponder what role the IBOutlet plays in this setup?

Thanks in advance.
 
Hi again Mdeh,
It sounded strange and interesting at the same time so decided to test it myself.
I just tested removal of the outlet in my software and the about panel do not want to be shown. I do have to have it in order to get it working.

By the way when removing the outlet and saving the AppController.h file the Interface Builder lights a warning sign in the File's Owner connections. So it already knows that he lacks the outlet connection.

best regards
/petron
 
I just tested removal of the outlet in my software and the about panel do not want to be shown. I do have to have it in order to get it working.
/petron


Hmmmm.....
In the panel attributes (of IB) is "Visible At Launch" checked?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.