Re: NSUserDefaults for portable applications
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