mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-30 17:20:48 +00:00
Use proper key-value coding method to get the value
This commit is contained in:
parent
282096f867
commit
f3d3dc386b
1 changed files with 10 additions and 6 deletions
|
@ -15,6 +15,9 @@
|
|||
Author: Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
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 <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSIndexSet.h>
|
||||
#import <Foundation/NSKeyValueCoding.h>
|
||||
#import <Foundation/NSMapTable.h>
|
||||
#import <Foundation/NSNotification.h>
|
||||
#import <Foundation/NSNull.h>
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue