Re: creating multiple NSTimers
Re: creating multiple NSTimers
- Subject: Re: creating multiple NSTimers
- From: John Pannell <email@hidden>
- Date: Thu, 29 Sep 2011 16:18:27 -0600
Hi Tom-
Could you use a single, repeating timer with sufficient resolution for your purposes and an array or dictionary storing the needed timing state? Then update state appropriately at each fire of the single timer?
Array {
Timing Item 1 {
currentTime: 24.2
running: YES
expires: 60.0
}
Timing Item 2 {
… etc.
}
}
- (void)doSomething:(NSTimer *)timer
{
// increment timing state
// expire overdue items
// etc.
}
Not sure of what you're trying to accomplish; perhaps this a different way to consider the issue. HTH!
John
John Pannell
http://www.positivespinmedia.com
On Sep 29, 2011, at 4:06 PM, Tom Hohensee wrote:
> Yes. What I have worked on is using an array of timers fired sequentially. Each firing of the timer sets up the next one in the array. Each new addition to the array requires invalidating of the active timer and reordering of the array according to times. But i have run into problems when two or more timers are set to fire at the same time.
>
> Tom
_______________________________________________
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