X-Git-Url: http://git.ithinksw.org/ITFoundation.git/blobdiff_plain/6262c31ef1f3b4c4cec3e909f0ecc189eb242ab2..744612b5d258474e367710b870a5caaed7d11ab9:/ITThreadChild.m diff --git a/ITThreadChild.m b/ITThreadChild.m new file mode 100644 index 0000000..4b2dd85 --- /dev/null +++ b/ITThreadChild.m @@ -0,0 +1,23 @@ +#import "ITThreadChild.h" + +@implementation ITThreadChild + ++ (void)runWithPorts:(NSArray *)portArray { + NSAutoreleasePool *pool; + NSConnection *parentConnection; + id childObject; + + pool = [[NSAutoreleasePool alloc] init]; + + parentConnection = [NSConnection connectionWithReceivePort:[portArray objectAtIndex:0] sendPort:[portArray objectAtIndex:1]]; + + childObject = [self alloc]; + if ([(id )[parentConnection rootProxy] registerThreadedChild:childObject]) { + [[NSRunLoop currentRunLoop] run]; + } + + [childObject release]; + [pool release]; +} + +@end