Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backing up NSUserDefaults and synching iPhone

Is the application domain in [NSUserDefaults standardUserDefaults] backed up when the user synchs their device? If not, can you suggest a close correct alternative?

Apple makes reference to "Application Preferences" in its documentation, such as regards in-app purchasing. I understand, perhaps incorrectly, that they're making reference to NSUserDefaults here although the terminology doesn't appear to match perfectly.

In-app purchases, which I plan to record in [NSUserDefaults standardUserDefaults], need to be backed up in my project.

Thanking you kindly in advance.

like image 971
SK9 Avatar asked Jan 26 '11 04:01

SK9


1 Answers

Yes. NSUserDefaults uses a PLIST file as a backing store, which is backed up on each sync. See http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/UserDefaults/Concepts/DefaultsDomains.html for more information.

If you wanted to see for yourself, you could check out ~/Library/Application Support/MobileSync/Backup/. Create an unencrypted backup of a device with just your app on it, and view the files in the PLIST editor.

like image 107
Jeremy Massel Avatar answered Oct 07 '22 11:10

Jeremy Massel