Binding to Desktop Image Path?
Binding to Desktop Image Path?
- Subject: Binding to Desktop Image Path?
- From: "Christopher Hickman" <email@hidden>
- Date: Tue, 9 May 2006 13:57:44 -0400
Can this code be replaced with a binding with NSUserDefaultsController?
/* begin code snippet */
NSUserDefaults *uDef = [NSUserDefaults standardUserDefaults];
NSDictionary *uDefDict = [[[uDef
persistentDomainForName:@"com.apple.desktop"] objectForKey:@"Background"]
objectForKey:@"default"];
NSString *imagePath = [uDefDict objectForKey:@"ImageFilePath"];
/* end code snippet */
I tried binding the value of an NSTextField in my nib to the
NSUserDefaultsController, using:
Bind to: Shared User Defaults
Controller Key: values
Model Key Path: com.apple.com.Background.default.ImageFilePath
The NSTextField ends up nil. I still don't fully understand the controller
key and model key stuff for bindings, so I'm probably using it wrong. How
should I reference this? I know I can't pull this string directly from the
command line with defaults read, since I can't go deeper than the dictionary
in the com.apple.desktop domain with the key Background.
Topher
_______________________________________________
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