00001
00002
00003
00004
00005
00006
00007
00008
00009 #import "LLDOReceiver.h"
00010
00011
00012 @implementation LLDOReceiver
00013
00014 NSConnection *theConnection;
00015
00016 - (id) init {
00017 self = [super init];
00018 if (self != nil) {
00019 target = nil;
00020 selector = nil;
00021 theConnection = [NSConnection defaultConnection];
00022 [theConnection setRootObject:self];
00023
00024
00025 if ([theConnection registerName:@"LLDOServer"] == NO) {
00026 NSLog(@"LLDOReceiver.init failed, cannot obtain the default connection for this thread ");
00027 theConnection = nil;
00028 return nil;
00029 }
00030
00031
00032
00033 }
00034 return self;
00035 }
00036
00037 - (void) setTarget:(id)newTarget withSelector:(SEL)newSelector {
00038 target = newTarget;
00039 selector = newSelector;
00040 }
00041
00042 - (void) invokeWithUserData:(id)data {
00043 if ((target != nil) && (selector != nil)) {
00044
00045 [target performSelector:selector withObject:data];
00046 } else {
00047 NSLog(@"LLDOReceiver.invokeWithUserData called but have no target or selector");
00048 }
00049 }
00050
00051 @end