Skip to content

Commit

Permalink
Add method _keyPathForValueBinding in _setObjectValue for Outline view
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasa committed Aug 21, 2024
1 parent 27d57fe commit 1a188b7
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Source/NSOutlineView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2048,15 +2048,13 @@ - (void) _setObjectValue: (id)value
forTableColumn: (NSTableColumn *)tb
row: (NSInteger) index
{
NSString *keyPath = [tb _keyPathForValueBinding];

// If we have content binding the data source is used only
// like a delegate
NSDictionary *info = [GSKeyValueBinding infoForBinding: NSValueBinding forObject: tb];
if (info != nil)
if (keyPath != nil)
{
id theItem = [_items objectAtIndex: index];
NSString *ikp = [info objectForKey: NSObservedKeyPathKey];
NSUInteger location = [ikp rangeOfString: @"."].location;
NSString *keyPath = (location == NSNotFound ? ikp : [ikp substringFromIndex: location + 1]);

// Set the value on the keyPath.
[theItem setValue: value
Expand Down

0 comments on commit 1a188b7

Please sign in to comment.