Skip to content

Commit

Permalink
Fix issues with setting editable property on NSTableColumn and call _…
Browse files Browse the repository at this point in the history
…keyPathForValueBinding
  • Loading branch information
gcasa committed Aug 21, 2024
1 parent 8ed8754 commit e1f3109
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions Source/NSTableColumn.m
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,10 @@ - (void) setValue: (id)anObject forKey: (NSString*)aKey
}
else if ([aKey isEqual: NSEditableBinding])
{
NSNumber *v = [anObject valueForKey: NSEditableBinding];
_is_editable = [v boolValue];
if ([anObject isKindOfClass: [NSNumber class]])
{
_is_editable = [anObject boolValue];
}
}
else
{
Expand Down
10 changes: 5 additions & 5 deletions Source/NSTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2062,6 +2062,7 @@ - (void) _initDefaults
_registeredNibs = [[NSMutableDictionary alloc] init];
_registeredViews = [[NSMutableDictionary alloc] init];
_rowViews = [[NSMutableDictionary alloc] init];
_dataSource_editable = YES;
}

- (id) initWithFrame: (NSRect)frameRect
Expand Down Expand Up @@ -6838,14 +6839,13 @@ - (void) _setObjectValue: (id)value
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];
Expand Down

0 comments on commit e1f3109

Please sign in to comment.