How to kill a thread?
How to kill a thread?
- Subject: How to kill a thread?
- From: Tackel <email@hidden>
- Date: Sun, 19 Jan 2003 18:07:43 +0100
Hi,
I don't know how to stop a thread, any idea?
I have a search process running in a separate thread and want to let the
user to stop it. Here is an example of the code:
-(void)search{
id p=[NSAutoreleasePool new];
search_process
[p release];
searching= FALSE;
}
- (IBAction)start:(id)sender
{
if (!searching) {
searching =TRUE;
[startbutton setTitle : @"stop"];
id p=[NSAutoreleasePool new];
[NSThread detachNewThreadSelector:@selector(search) toTarget:self
withObject:nil];
[p release];
}
else
how to stop the search process???
}
Thanks,
Tackel.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.