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: Aaron Braunstein <email@hidden>
- Date: Sun, 1 Aug 2004 14:56:07 -0700
Thanks... Unfortunately I had to be out of eMail contact and hit upon
the application delegate solution by sitting back and reviewing the
options that I knew of. That having been said, I really like the
singleton method and may switch over to that. Thanks for the feedback!
On Jul 31, 2004, at 12:24 PM, Chris Hanson wrote:
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/
--
Aaron Braunstein
"Good enough" shouldn't be. From there the fall into mediocrity and
indifference is a short one.
_______________________________________________
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.