mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Implement two missing KVO methods on NSArray.
This commit is contained in:
parent
dc38eb5b0f
commit
36d00c7f00
2 changed files with 30 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
2020-01-12 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Source/NSKeyValueObserving.m: Implement two missing KVO methods
|
||||
on NSArray.
|
||||
|
||||
2019-12-15 Fred Kiefer <fredkiefer@gmx.de>
|
||||
|
||||
* Headers/GNUstepBase/GSIMap.h: Use GSI_MAP_NODE_IS_EMPTY macros
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#import "Foundation/NSEnumerator.h"
|
||||
#import "Foundation/NSException.h"
|
||||
#import "Foundation/NSHashTable.h"
|
||||
#import "Foundation/NSIndexSet.h"
|
||||
#import "Foundation/NSKeyValueCoding.h"
|
||||
#import "Foundation/NSKeyValueObserving.h"
|
||||
#import "Foundation/NSLock.h"
|
||||
|
@ -1579,7 +1580,19 @@ cifframe_callback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
options: (NSKeyValueObservingOptions)options
|
||||
context: (void*)aContext
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
NSUInteger i = [indexes firstIndex];
|
||||
|
||||
while (i != NSNotFound)
|
||||
{
|
||||
NSObject *elem = [self objectAtIndex: i];
|
||||
|
||||
[elem addObserver: anObserver
|
||||
forKeyPath: aPath
|
||||
options: options
|
||||
context: aContext];
|
||||
|
||||
i = [indexes indexGreaterThanIndex: i];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) removeObserver: (NSObject*)anObserver forKeyPath: (NSString*)aPath
|
||||
|
@ -1593,7 +1606,17 @@ cifframe_callback(ffi_cif *cif, void *retp, void **args, void *user)
|
|||
fromObjectsAtIndexes: (NSIndexSet*)indexes
|
||||
forKeyPath: (NSString*)aPath
|
||||
{
|
||||
[self notImplemented: _cmd];
|
||||
NSUInteger i = [indexes firstIndex];
|
||||
|
||||
while (i != NSNotFound)
|
||||
{
|
||||
NSObject *elem = [self objectAtIndex: i];
|
||||
|
||||
[elem removeObserver: anObserver
|
||||
forKeyPath: aPath];
|
||||
|
||||
i = [indexes indexGreaterThanIndex: i];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue