Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Document object talking to main application object



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.


References: 
 >Document object talking to main application object (From: Aaron Braunstein <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.