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

Re: storing default preferences


  • Subject: Re: storing default preferences
  • From: cauri <email@hidden>
  • Date: Sun, 14 Mar 2004 23:18:46 +0100

Thank you. That works great.

-cauri

On Mar 14, 2004, at 22:17, Charles Srstka wrote:

You can just keep a plist called "defaults.plist" in your app's bundle, and get it like this:

+ (void)initialize {
NSString *defaultsPath = [[NSBundle mainBundle] pathForResource:@"defaults" ofType:@"plist"];
NSDictionary *defaults = [NSDictionary dictionaryWithContentsOfFile:defaultsPath];

[[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
}

That should make it pretty easy to tweak your app's default values.

Charles

On Mar 14, 2004, at 2:27 PM, cauri wrote:

Thank you, however the first time the application runs, before the I write the plist file, I need to store the initial data for those preference lists (arrays) somewhere. What is the best method?
_______________________________________________
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: 
 >storing default preferences (From: cauri <email@hidden>)
 >Re: storing default preferences (From: Hiro Fujimoto <email@hidden>)
 >Re: storing default preferences (From: cauri <email@hidden>)

  • Prev by Date: Java-Cocoa memory problem
  • Next by Date: XML-RPC calls in Cocoa - alternative to CURLHandle?
  • Previous by thread: Re: storing default preferences
  • Next by thread: Re: storing default preferences
  • Index(es):
    • Date
    • Thread