: @keeluu .
, IB, "getcha", . :
// Assume 'anObjectController' is an NSObjectController.
// Assume 'userDefaultsController' is [NSUserDefaultsController sharedUserDefaultsController]
// Assume 'someDictionary' is an NSDictionary in userDefaults.
[self.anObjectController
bind:NSContentBinding
toObject:userDefaultsController
withKeyPath:@"values.someDictionary"
options:@{NSHandlesContentAsCompoundValueBindingOption: @YES}];
, , someDictionary, , , (, ), ; .
NSContentObjectBinding NSContentBinding. NSObjectController contentObject. , .
This is not an easy mistake, because the end of the Xcode code automatically jumps to NSContentBinding, and this is one of the most commonly used binding names. It just cost me a lot of trouble, so I hope I saved something for someone else.
source
share