diff --git a/AppKit/CPArrayController.j b/AppKit/CPArrayController.j index 6d3f92abf..66e75cefc 100644 --- a/AppKit/CPArrayController.j +++ b/AppKit/CPArrayController.j @@ -910,6 +910,33 @@ @end +@implementation CPArrayController (CPBinder) + ++ (Class)_binderClassForBinding:(CPString)theBinding +{ + if (theBinding == @"contentArray") + return [_CPArrayControllerContentBinder class]; + + return [super _binderClassForBinding:theBinding]; +} + +@end + +@implementation _CPArrayControllerContentBinder : CPBinder + +- (void)setValueFor:(CPString)aBinding +{ + var destination = [_info objectForKey:CPObservedObjectKey], + keyPath = [_info objectForKey:CPObservedKeyPathKey], + options = [_info objectForKey:CPOptionsKey], + newValue = [destination mutableArrayValueForKeyPath:keyPath]; + + newValue = [self transformValue:newValue withOptions:options]; + [_source setValue:newValue forKey:aBinding]; +} + +@end + var CPArrayControllerAvoidsEmptySelection = @"CPArrayControllerAvoidsEmptySelection", CPArrayControllerClearsFilterPredicateOnInsertion = @"CPArrayControllerClearsFilterPredicateOnInsertion", CPArrayControllerFilterRestrictsInsertion = @"CPArrayControllerFilterRestrictsInsertion",