From f3d3dc386b94cba0cefed4965518ebe8dc83d6c7 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Mon, 20 Mar 2023 07:43:57 -0400 Subject: [PATCH] Use proper key-value coding method to get the value --- Source/NSOutlineView.m | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Source/NSOutlineView.m b/Source/NSOutlineView.m index 9bf6d78e0..926fdc752 100644 --- a/Source/NSOutlineView.m +++ b/Source/NSOutlineView.m @@ -15,6 +15,9 @@ Author: Gregory John Casamento Date: October 2001 + KVO Support Added by greg.casamento@gmail.com. + Date: March 2023 + This file is part of the GNUstep GUI Library. This library is free software; you can redistribute it and/or @@ -39,6 +42,7 @@ #import #import #import +#import #import #import #import @@ -2137,13 +2141,13 @@ Also returns the child index relative to this parent. */ } else { - NSString *countKey = [source countKeyPath]; - SEL countSel = NSSelectorFromString(countKey); - NSString *childrenKey = [source childrenKeyPath]; - SEL childrenSel = NSSelectorFromString(childrenKey); + NSString *countKeyPath = [source countKeyPath]; + NSString *childrenKeyPath = [source childrenKeyPath]; + NSNumber *n = nil; - contentArray = (NSArray *)[sitem performSelector: childrenSel]; - num = (NSUInteger)[sitem performSelector: countSel]; + contentArray = (NSArray *)[sitem valueForKey: childrenKeyPath]; + n = (NSNumber *)[sitem valueForKey: countKeyPath]; + num = [n integerValue]; } if (num > 0)