mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Operation queue convenience methods
This commit is contained in:
parent
6b04eaa35c
commit
4c9c691626
4 changed files with 121 additions and 3 deletions
|
@ -22,9 +22,12 @@
|
|||
|
||||
*/
|
||||
#import "../common.h"
|
||||
#import "Foundation/NSDictionary.h"
|
||||
#import "Foundation/NSException.h"
|
||||
#import "Foundation/NSMapTable.h"
|
||||
#import "Foundation/NSObject.h"
|
||||
#import "Foundation/NSOperation.h"
|
||||
#import "GNUstepBase/GSObjCRuntime.h"
|
||||
#import "GNUstepBase/NSOperationQueue+GNUstepBase.h"
|
||||
|
||||
|
||||
|
@ -72,6 +75,23 @@
|
|||
*/
|
||||
@implementation NSOperationQueue (GNUstepBase)
|
||||
|
||||
- (void) addOperationWithTarget: (id<NSObject>)aTarget
|
||||
performSelector: (SEL)aSelector
|
||||
withMap: (id)firstKey, ...
|
||||
{
|
||||
GSTargetOperation *top;
|
||||
NSDictionary *map;
|
||||
|
||||
map = [NSDictionary alloc];
|
||||
GS_USEIDPAIRLIST(firstKey,
|
||||
map = [map initWithObjects: __pairs forKeys: __objects count: __count/2]);
|
||||
|
||||
top = [GSTargetOperation operationWithTarget: aTarget
|
||||
performSelector: aSelector
|
||||
withObject: AUTORELEASE(map)];
|
||||
[self addOperation: top];
|
||||
}
|
||||
|
||||
- (void) addOperationWithTarget: (id<NSObject>)aTarget
|
||||
performSelector: (SEL)aSelector
|
||||
withObject: (id<NSObject>)object1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue