• 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: registering Defaults with NSUserDefaults not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: registering Defaults with NSUserDefaults not working


  • Subject: Re: registering Defaults with NSUserDefaults not working
  • From: Keary Suska <email@hidden>
  • Date: Mon, 1 Mar 2010 08:07:15 -0700

On Mar 1, 2010, at 3:01 AM, Gustavo Pizano wrote:

> [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
> if([[NSUserDefaults standardUserDefaults] synchronize])NSLog(@"Could Save");

-registerDefaults: does not actually change default values, it simply sets what the default values should be in certain cases. You can read NSUserDefaultsController about ways to use default values. If you delete your plist preference file, then re-run, you might see different results. You might be happier in the long wrong if you follow the docs and have all of your application defaults in app delegate's +initialize, or as a pre-defined plist in your project. You also don't need to call -synchronize if your app will terminate normally (saving defaults is one of the exit functions).

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: registering Defaults with NSUserDefaults not working
      • From: Gustavo Pizano <email@hidden>
References: 
 >registering Defaults with NSUserDefaults not working (From: Gustavo Pizano <email@hidden>)

  • Prev by Date: Re: Connecting Outlet on Derived Array Controller
  • Next by Date: Re: registering Defaults with NSUserDefaults not working
  • Previous by thread: registering Defaults with NSUserDefaults not working
  • Next by thread: Re: registering Defaults with NSUserDefaults not working
  • Index(es):
    • Date
    • Thread