On Jan 4, 2017, at 14:11 , Jean-Daniel <mail...@xenonium.com> wrote:
> 
> When using storyboard, the only way to instantiate window is by getting a 
> reference to the window controller (by using 
> -instantiateControllerWithIdentifier:), so it should not be an issue.

The problem I was referring to is when the window [scene] is in the initial 
controller. There’s no way (AFAIK) that you can statically set up a reference 
to the WC in any combination of IB/code, and of course the storyboard 
instantiation is not in your code.

Again AFAIK, you can get a reference to this WC from the window, and you can 
get the [main] window from the NSApplication object, or from a view 
controller’s view, but all of these things require you to defer getting the 
reference until the objects are created and functional.

Or, you can subclass NSWindowController, and have the windowDidLoad override 
add a controller reference to data structures somewhere.

But I think the old days when the template project provided a window controller 
property on the app delegate for you are gone.

Of course, I’d be extremely happy to be wrong about this. (I assume the tea 
leaves indicate that window controllers are on the way out, so don’t get too 
used to them.)
_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to