• 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: NSUserDefaults for portable applications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUserDefaults for portable applications


  • Subject: Re: NSUserDefaults for portable applications
  • From: Conor Dearden <email@hidden>
  • Date: Mon, 13 Feb 2006 10:17:03 +0100

> What would you suggest as best practice to make the application
> preferences portable (so the application won't modify and store
> preferences on the 'guest' system)?

NSUserDefaults is a simply a plist dictionary. You can save your own and
load your own dictionary at a specified path (on your mobile media) at
applicationWillFinishLaunching and applicationWillTermiante delegate methods
or notification.

Load
1. load dictionary with dictionaryWithContents... convenience method
2. NSUserDefualts - (void)registerDefaults:(NSDictionary *)dictionary


Quit

1.  (NSDictionary *)persistentDomainForName:(NSString *)domainName
(com.mycompany.myapp)
2. save to file with writeToFile...

Conor
www.bruji.com


 _______________________________________________
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

  • Follow-Ups:
    • Re: NSUserDefaults for portable applications
      • From: "David V. Kocher" <email@hidden>
  • Prev by Date: Re: Affine Transform
  • Next by Date: nsarraycontroller, bindings and big databases
  • Previous by thread: NSUserDefaults for portable applications
  • Next by thread: Re: NSUserDefaults for portable applications
  • Index(es):
    • Date
    • Thread