• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Document object talking to main application object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


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

  • Prev by Date: Re: Animation and crossfading of windows
  • Next by Date: WORKAROUND: Bound popup's current selection
  • Previous by thread: Re: Document object talking to main application object
  • Next by thread: DVDPlayback.framework will not initialize under debugger
  • Index(es):
    • Date
    • Thread