How best to access application-scope objects from documents
How best to access application-scope objects from documents
- Subject: How best to access application-scope objects from documents
- From: Paul Thomas <email@hidden>
- Date: Thu, 22 Mar 2007 09:48:07 +0000
Hi,
this is really a question about best practise in Document
Architecture designs which are NIB based.
I'm adding a preferences controller to my application to manage all
of the NSUserDefaults and also control a preferences window. This is
all going swimmingly but, being a little new to the whole NIB-based
thing, I'm not sure how the document objects should be accessing this
controller.
The controller is instantiated by the MainMenu NIB - but it isn't
hooked up to anything except the menu. So far as I can see, I can
either look through the top level objects or add an outlet to the
application delegate (prefer the later). But then I have to get the
reference to the documents. Do I need to subclass the document
controller to pass it to the initialiser, or is it better to 'reach
back' and traverse the object graph from doc through app to the
delegate. They both seem a bit messy unless I've missed something.
cheers,
paul.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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