• 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
creating multiple NSTimers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

creating multiple NSTimers


  • Subject: creating multiple NSTimers
  • From: Tom Hohensee <email@hidden>
  • Date: Thu, 29 Sep 2011 16:47:28 -0500

For the life of me I cannot figure this one out.  I need to create an indeterminate amount of timers for an app I am working on.  The app is petty simple.  For example, provide a list of ip enabled devices with times to shut off and the app executes the device's shutdown at the specified time.  I need to retain a reference to each timer so that I can invalidate the timer if necessary.  Obviously setting up one timer or two timers is not a problem.

NSTimer *myTimer1;
NSTimer *myTimer2;
etc.........

However, I do not know wether the user will have 1 device or 100 devices.  Do I have to setup a finite amount of timers (ultimately having a limit on the number of devices that can be added) or is there a better way?  I have googled for a while now trying to find example code but have come up empty (plenty of finite examples).  I see there are timer applications out there that seem to handle an infinite number of timers.

Thanks
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

  • Follow-Ups:
    • Re: creating multiple NSTimers
      • From: David Duncan <email@hidden>
    • Re: creating multiple NSTimers
      • From: "Eric E. Dolecki" <email@hidden>
  • Prev by Date: Question about SMJobBless
  • Next by Date: Re: creating multiple NSTimers
  • Previous by thread: Re: Question about SMJobBless
  • Next by thread: Re: creating multiple NSTimers
  • Index(es):
    • Date
    • Thread