On Jul 7, 2011, at 5:03 AM, Kevin Muldoon wrote:

> So, I'm not entirely certain Wim. I kinda feel I'm caught between the xCode
> 3 way of doing things and xCode 4 (and all the variants in between).

I don’t see a difference. Xcode is just a tool; it doesn’t dictate the ways you 
develop code. If anything, it’s the releases of the OS that introduce and 
deprecate ways of doing things.

And both NSWindowController and manual nib loading have been around forever.

> 1) So, how exactly is SecondWindow.m going to know about and act upon a 
> NSButton or NSTextField within in the SecondWindow.xib?

The usual way: You declare the button as an IBOutlet in SecondWindow’s instance 
variable declarations, and wire it up to the actual control in IB.

> 2) Shouldn't [secondWindow close] be working just as [secondWindow window] is 
> working?

Actually calling -window isn’t the right way to show the window. All it does is 
cause the window to be loaded; this may or may not cause the window to be 
visible depending on how you set the ‘visible at launch time’ flag on the 
window in IB. Usually you want this flag to be false so that NSWindowController 
can customize the window bounds (tiling or restoring) before it’s displayed. If 
you want to show the window, call -showWindow:.

> For some reason,  [secondWindow close]  isn't working at all. At least the 
> documentation says this is how it's done.

Hm. My first guess is that you didn’t wire up the window to the 
NSWindowController’s inherited ‘window’ outlet. Lots of things won’t work 
unless you do this. (You also have to wire up the window’s delegate to the 
controller.)

—Jens_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to