Re: Document object talking to main application object
Re: Document object talking to main application object
- Subject: Re: Document object talking to main application object
- From: Chris Hanson <email@hidden>
- Date: Sat, 31 Jul 2004 12:24:32 -0700
On Jul 30, 2004, at 3:02 PM, Aaron Braunstein wrote:
As I said, neither of these is working for me.
What else should I consider in order to achieve my goal of having
document instances be able to reach back and talk to the preference
object? Thanks...
You have a couple options. You could use a singleton design pattern,
where you have a class method on PreferencesController that returns the
default PreferencesController. Use that everywhere, and you'll always
be talking to the same one.
Another option would be to make your application delegate be the object
that manages the PreferencesController. Then you can just have an
accessor on that to get it, and use [[NSApp delegate]
preferencesController] to get to it.
Finally, you can try to structure your preferences in such a way that
you don't need a PreferencesController, and you just access the user
defaults where you need preferences.
-- Chris
--
Chris Hanson <email@hidden>
http://www.livejournal.com/users/chanson/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.