Threading...
Threading...
- Subject: Threading...
- From: "Brian O'Brien" <email@hidden>
- Date: Wed, 9 Feb 2005 16:06:05 -0700
I have the following:
in dicomSCP.h
@interface dicomSCP : NSObject {
}
+ (void) ThreadMethod:(id)anObject;
- (void) InstanceThreadMethod:(id)anObject;
@end
in dicomSCP.mm
@implementation dicomSCP
+ (id)anObject
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Do thread work here
[pool release];
}
- (id)anObject
{
}
@end
in main.mm
#include "dicomSCP.h"
int main(int argc, char *argv[])
{
[NSThread detachNewThreadSelector:@selector(ThreadMethod:) toTarget:[dicomSCP class] withObject:nil];
return NSApplicationMain(argc, (const char **) argv);
}
My questions are:
1) Is there a better place to start the thread?
2) Where is the instance of my class dicomSCP? Without one I don't know how to call 'thread safe' member functions.
3) I don't get the + / - in front of the methods.. Instance vs. Class?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden