Cocoa bindings with NSUserDefaultsController
Cocoa bindings with NSUserDefaultsController
- Subject: Cocoa bindings with NSUserDefaultsController
- From: David Hoerl <email@hidden>
- Date: Tue, 11 Jul 2006 13:11:08 -0400
In
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/NSUserDefaultsController.html
Apple tells us to programmatically set values thusly:
[[theDefaultsController values] setValue:newUserName forKey:@"userName"];
That is, to get the "values" object, then to set its value.
However, when you do bindings in IB to a NSUserDefaultsController, it
would imply that the binding is done as:
[theDefaultsController setValue:newUserName forKey:@"values.userName"];
Trying the above, it fails with an error:
[<NSUserDefaultsController 0x3e6800> setValue:forUndefinedKey:]: this
class is not key value coding-compliant for the key values.userName
Just trying to understand why I can get an object, then set a value,
but I cannot set the value by messaging the controller directly.
David
_______________________________________________
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