Re: Dynamically loading a part of a Window in Cocoa
Re: Dynamically loading a part of a Window in Cocoa
- Subject: Re: Dynamically loading a part of a Window in Cocoa
- From: Keith Duncan <email@hidden>
- Date: Wed, 01 Jul 2009 19:37:16 +0100
On 1 Jul 2009, at 18:26, Quincey Morris wrote:
Either you have to defeat the modularization by binding to File's
Owner.windowController.whatever (File's Owner being the view
controller subclass, of course, and windowController being a
property you added to it)
This is how I do it, but I don't add a windowController property to
each of the the view controllers. I instead add a parentController
outlet typed as id; which allows the parent to be either a window
controller or another view controller.
Then add a -windowController getter in an NSViewController category
which walks the parentController chain and finds the top-level
controller which -isKindOfClass:[NSWindowController class]
This retains the modularity of the view controllers and still provides
simple access to the window controller's properties and document.
Keith
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden