• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: creating multiple NSTimers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >creating multiple NSTimers (From: Tom Hohensee <email@hidden>)
 >Re: creating multiple NSTimers (From: David Duncan <email@hidden>)
 >Re: creating multiple NSTimers (From: Tom Hohensee <email@hidden>)

  • Prev by Date: Re: creating multiple NSTimers
  • Next by Date: delegate of an NWindowController's window
  • Previous by thread: Re: creating multiple NSTimers
  • Next by thread: Re: creating multiple NSTimers
  • Index(es):
    • Date
    • Thread