Accessing preferences of another application
Accessing preferences of another application
- Subject: Accessing preferences of another application
- From: Dragan Milić <email@hidden>
- Date: Wed, 23 Aug 2006 00:49:19 +0200
Hi all,
I know there must be a way to do this what I want, I just wasn't able
to find it reading documentation of NSUserDefaults class. I've got an
application with a bundle identifier, say, "com.mysite.myApp" and I
want to share preferences of that application between it and another
application, actually a plug-in of another application. So in my
application I use [NSUserDefaults standardUserDefaults] instance, as
usually. Now, I want to access the same preferences (basically the
same .plist file) from within mentioned plug-in. So far, I've been
using CFPreferences and specifying "com.mysite.myApp" as identifier
argument to every CFPreferences function call and it worked
flawlessly. Unfortunately, with CFPreferences there isn't a way to
define some kind of default preferences values to be used if there's
no corresponding user-set value in the saved settings (.plist file),
as there is with -[NSUserDefaults registerDefaults:] method. That
brings me back to Cocoa. So far, I haven't manage to access
preferences stored in "com.mysite.myApp.plist" file. I've tried to
instantiate my own NSUserDefaults instance with -alloc and -init, and
than to send it -addSuiteNamed:, passing my app identifier as an
argument, I've also tried with -setPersistantDomain:forName:, but
without success.
Any suggestions? Please note that I also need to register default
preferences values with -registerDefaults: every time the plug-in
(that is its hosting app) is launched. Thanks.
Cheers,
Milke
_______________________________________________
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