NSTableView experimental changes to improve bindings

This commit is contained in:
Gregory John Casamento 2024-08-23 03:29:19 -04:00
parent 3c160c9bb8
commit 691bf4391b

View file

@ -6842,15 +6842,24 @@ For a more detailed explanation, -setSortDescriptors:. */
NSString *keyPath = [tb _keyPathForValueBinding];
if (keyPath != nil)
{
NSArray *items = [[theBinding observedObject] arrangedObjects];
if (items != nil)
id array = [theBinding destinationValue];
id obj = [array objectAtIndex: index];
NSMutableArray *newArray = [NSMutableArray arrayWithArray: array];
NSLog(@"array = %@", array);
NSLog(@"array class = %@", [array class]);
NSLog(@"obj = %@", obj);
NSLog(@"class = %@", NSStringFromClass([obj class]));
[newArray replaceObjectAtIndex: index withObject: value];
[theBinding reverseSetValue: newArray];
// obj = value;
/*
if (obj != nil)
{
id obj = [items objectAtIndex: index];
if (obj != nil)
{
[obj setValue: value forKeyPath: keyPath];
}
}
[obj setValue: value forKeyPath: keyPath];
}*/
}
}
else if ([_dataSource respondsToSelector: