I'd like to share a preference between two apps (a game and its editor). How can I best accomplish this? I thought the game could explicitly read from the editor's preferences plist, but I'm not sure what the cleanest way to achieve this is.
NSUserDefaults
maintains a list of domains to search. By default it just looks at your application's preferences file, but you can have it search other places.
You can do something like this:
NSUserDefaults *defaults = [[NSUserDefaults alloc] init];
[defaults addSuiteNamed:@"com.example.game.shared-prefs"];
To share preferences between apps.
Just drop down to CFPreferences APIs for the expert parameters. NSUserDefaults
' idea of preferences is for an app, but CFPreferences allow you to defines hosts, suites, and so on for the type of multi-app preferences you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With