Stopwatch
Stopwatch
- Subject: Stopwatch
- From: Sanri Parov <email@hidden>
- Date: Sun, 12 Jun 2005 19:59:47 +0200
Hi everybody,
I'm building a stopwatch for my app and I need to start a new thread
for the counting job.
Now, I've managed to fire up a new thread... but I don't know how to
stop it when the user press
a particular button.
------------------------------------------------------------------
- (IBAction)timerStartStop:(id)sender
{
if (timerStatus==NO)
thread =[NSThread detachNewThreadSelector:@selector(timer)
toTarget:self withObject:nil];
else
thread=[NSThread exit];
}
-(void) timer
{
NSTimeInterval intervallo;
date = [NSDate date];
for(;;)
{
intervallo = [date timeIntervalSinceNow];
NSLog(@"%f",intervallo);
}
}
------------------------------------------------------------------
Quite obviously the app doesn't know what to kill and then... suicide
itself.
Can you please help me ?
Thanks.
--
Sanri Parov
_______________________________________________
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