creating multiple NSTimers
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