Re: NSTimer
Re: NSTimer
- Subject: Re: NSTimer
- From: Joseph Kelly <email@hidden>
- Date: Thu, 04 Dec 2008 06:55:04 -0800
You could call [self myThread:nil] after you start your timer.
Joe K.
On Dec 4, 2008, at 3:17 AM, Mahaboob wrote:
Hi,
I need to fire the thread repeatedly in regular time intervals. So I
used
the timer like:
timer = [[NSTimer scheduledTimerWithTimeInterval:(double)
[txtTimeinterval
doubleValue] target:self selector:@selector(myThread:) userInfo:nil
repeats:YES]retain];
It is working but, the thread is fired only after the the time
interval I
had given. But actually I need to begin the thread in 0Sec and then
keep the
regular time interval. For that I used the code :
NSDate* theDate = [NSDate dateWithTimeIntervalSinceReferenceDate:0];
[[timer initWithFireDate:theDate interval:(double)[txtTimeinterval
doubleValue] target:self selector:@selector(myThread:) userInfo:nil
repeats:YES]retain];
But it is not firing the thread.
Where I got wrong?
How can I do this?
Thanks in advance
mahaboob
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >NSTimer (From: Mahaboob <email@hidden>) |