Fix issues with setting editable property on NSTableColumn and call _keyPathForValueBinding

This commit is contained in:
Gregory John Casamento 2024-08-21 00:12:03 -04:00
parent 8ed8754b2a
commit e1f3109c94
2 changed files with 9 additions and 7 deletions

View file

@ -750,8 +750,10 @@ to YES. */
}
else if ([aKey isEqual: NSEditableBinding])
{
NSNumber *v = [anObject valueForKey: NSEditableBinding];
_is_editable = [v boolValue];
if ([anObject isKindOfClass: [NSNumber class]])
{
_is_editable = [anObject boolValue];
}
}
else
{

View file

@ -2062,6 +2062,7 @@ static void computeNewSelection
_registeredNibs = [[NSMutableDictionary alloc] init];
_registeredViews = [[NSMutableDictionary alloc] init];
_rowViews = [[NSMutableDictionary alloc] init];
_dataSource_editable = YES;
}
- (id) initWithFrame: (NSRect)frameRect
@ -6838,14 +6839,13 @@ For a more detailed explanation, -setSortDescriptors:. */
forObject: tb];
if (theBinding != nil)
{
NSArray *items = [[theBinding observedObject] arrangedObjects];
if (items != nil)
NSString *keyPath = [tb _keyPathForValueBinding];
if (keyPath != nil)
{
NSString *keyPath = [tb _keyPathForValueBinding];
if (keyPath != nil)
NSArray *items = [[theBinding observedObject] arrangedObjects];
if (items != nil)
{
id obj = [items objectAtIndex: index];
if (obj != nil)
{
[obj setValue: value forKeyPath: keyPath];