• 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: Sharing preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sharing preferences


  • Subject: Re: Sharing preferences
  • From: Bill Cheeseman <email@hidden>
  • Date: Wed, 30 Mar 2005 05:38:57 -0500

on 2005-03-29 7:01 PM, Chad Armstrong at email@hidden wrote:

> What would be the most effective way to share the data between the
> various controller classes?  Would it be advisable to create another
> controller (and associated files) just for the preference window and its
> controls/buttons, also?

Leaving aside Cocoa Bindings, the traditional approach would be to create a
separate nib file and controller for your preferences window and its
controls, just as you normally would for any separate window having its own
layout.

As to the preference data, you would use NSUserDefaults, which is well
documented. Initialize non-nil preference items in a +initialize method in
your preferences controller. Set individual preference items in your
preferences controller in response to user actions in the preferences
window. Read individual preference items whenever and wherever you need to
know how they're set, by accessing the NSUserDefaults singleton object.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Sharing preferences (From: Chad Armstrong <email@hidden>)

  • Prev by Date: Re: How to code a NSString literal with UTF8?
  • Next by Date: Nested sheets
  • Previous by thread: Re: Sharing preferences
  • Next by thread: Recommended Reading
  • Index(es):
    • Date
    • Thread