NSUserDefaultsController with defaults for another app
NSUserDefaultsController with defaults for another app
- Subject: NSUserDefaultsController with defaults for another app
- From: Keith Alperin <email@hidden>
- Date: Tue, 12 Aug 2008 23:11:30 -0500
Greetings Cocoa-devs!
My app ships as a System Preferences preference pane that contains a
faceless agent app inside it's bundle. The agent app provides all of
the functionality for my app. The prefpane stores preferences in the
plist file for my app (rather than that for the host System
Preferences app). I've been able to make this work by sending
persistentDomainForName: to the shared instance of NSUserDefaults.
Now i'm trying to use bindings in order to simplify displaying a
collection of dictionaries in an NSTable. I can see my preference
data via an NSUserDefaultsController if i initialize it like this
where defaultsController is actually an instance of NSObjectController:
NSUserDefaults *defaultsInstance = [NSUserDefaults
standardUserDefaults];
[defaultsInstance addSuiteNamed:DOMAIN];
NSUserDefaultsController *controller = [[NSUserDefaultsController
alloc] initWithDefaults: defaultsInstance initialValues: nil];
[defaultsController setContent:controller];
My NSTable shows the correct data, but when i update the information
it is persisted back to the com.apple.systempreferences.plist file,
and not the plist file for my app. Craig Hockenberry posted a similar
question about 3.5 years ago (http://tinyurl.com/5upqnp) without
receiving many responses and google has so far turned up very little.
Is there a way for me to bind my preferences to my view that's hosted
in another app (in this case System Preferences?).
Thank you so much,
Keith Alperin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden