• 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: Standard User Defaults - Setting initial values
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Standard User Defaults - Setting initial values


  • Subject: Re: Standard User Defaults - Setting initial values
  • From: Bruce Truax <email@hidden>
  • Date: Mon, 26 Apr 2004 18:43:21 -0400

You refer to an example in Listing 2 but there is no reference! Where can I
find this listing?

Bruce

>
> On Apr 25, 2004, at 10:27 PM, Bruce Truax wrote:
>
>> When using the Shared User Defaults Binding for UI elements, what is
>> the
>> proper way to set the initial values that the user will see on the
>> first
>> run?
>>
>
> Register them with NSUserDefaults using registerDefaults:. and you
> need to do that before any nibs load (so an app delegate +initialize
> method, or willFinishLaunching: delegate method.
>
> ---
> Care must be taken that changes to the settings of the shared user
> defaults controller are made before any nib files containing bindings
> to the shared controller are loaded. To ensure that these changes are
> made before any nib files are loaded, they are often implemented in the
> initialize class method of the application delegate, or in your
> preferences window controller.
> ---
>
> The initial values dictionary allows you to provide a means to reset
> the user configurable default values to the factory defaults. Typically
> these values represent a subset of the defaults that your application
> registers using the NSUserDefaults method registerDefaults:.
>
> Calling the NSUserDefaultsController method setInitialValues: should
> not be considered a replacement for registering your application's
> preference defaults using NSUserDefault's registerDefaults: method.
>
> The example in Listing 2 loads the default values from a file in the
> application wrapper, registers those values with NSUserDefaults, and
> then registers a subset of the values as the initial values of the
> shared user defaults controller. The setupDefaults method would be
> called from your application delegate9s initialize class method.
>
> ---

--
____________________________________________________________
Bruce E. Truax email: email@hidden
Optical Engineering Consultant

Diffraction Limited Design LLC
388 Wedgewood Road voice: 860-276-0450
Southington, CT 06489 fax: 860-620-9026
http://www.dld-llc.com
_____________________________________________________________
_______________________________________________
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.


  • Follow-Ups:
    • Re: Standard User Defaults - Setting initial values
      • From: Scott Anguish <email@hidden>
References: 
 >Re: Standard User Defaults - Setting initial values (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: Standard User Defaults - Setting initial values
  • Next by Date: Re: Standard User Defaults - Setting initial values
  • Previous by thread: Re: Standard User Defaults - Setting initial values
  • Next by thread: Re: Standard User Defaults - Setting initial values
  • Index(es):
    • Date
    • Thread