Update internal data source

This commit is contained in:
Gregory John Casamento 2023-07-24 14:14:17 -04:00
parent 48ea6692e1
commit a7894607af

View file

@ -105,7 +105,7 @@ static NSDate *lastDragChange = nil;
NSString *_childrenKeyPath; NSString *_childrenKeyPath;
NSString *_leafKeyPath; NSString *_leafKeyPath;
NSMutableDictionary *_internalRepresentation; NSMapTable *_internalRepresentation;
id _observedObject; id _observedObject;
NSOutlineView *_outlineView; NSOutlineView *_outlineView;
} }
@ -2284,7 +2284,7 @@ Also returns the child index relative to this parent. */
ASSIGNCOPY(_childrenKeyPath, [tc childrenKeyPath]); ASSIGNCOPY(_childrenKeyPath, [tc childrenKeyPath]);
ASSIGNCOPY(_countKeyPath, [tc countKeyPath]); ASSIGNCOPY(_countKeyPath, [tc countKeyPath]);
_internalRepresentation = [[NSMutableDictionary alloc] init]; _internalRepresentation = RETAIN([NSMapTable weakToWeakObjectsMapTable]);
} }
else else
{ {
@ -2354,6 +2354,7 @@ Also returns the child index relative to this parent. */
if (_theBinding != nil) if (_theBinding != nil)
{ {
NSArray *contentArray = (NSArray *)[_theBinding destinationValue]; NSArray *contentArray = (NSArray *)[_theBinding destinationValue];
[_internalRepresentation removeAllObjects];
[self _collectNodes: contentArray]; [self _collectNodes: contentArray];
NSLog(@"_internalRepresentation = %@", _internalRepresentation); NSLog(@"_internalRepresentation = %@", _internalRepresentation);
} }