Created
January 22, 2011 06:23
-
-
Save tonyarnold/790923 to your computer and use it in GitHub Desktop.
Need to migrate your preferences from an existing bundle ID? Use this in your App Delegate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (void)initialize { | |
| // Update the preferences location from the old location (which is now used for the App Store) | |
| NSDictionary *retailUserDefaults = [[NSUserDefaults standardUserDefaults] persistentDomainForName:[NSApp applicationIdentifier]]; | |
| if (retailUserDefaults == nil) { | |
| NSDictionary *macAppStoreUserDefaults = [[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.thecocoabots.hyperspaces"]; | |
| for (NSString *key in [macAppStoreUserDefaults allKeys]) { | |
| [[NSUserDefaults standardUserDefaults] setObject:[macAppStoreUserDefaults objectForKey:key] forKey:key]; | |
| } | |
| [[NSUserDefaults standardUserDefaults] synchronize]; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Whoops. Over-release!