Re: creating multiple NSTimers
Re: creating multiple NSTimers
- Subject: Re: creating multiple NSTimers
- From: "Eric E. Dolecki" <email@hidden>
- Date: Thu, 29 Sep 2011 17:51:05 -0400
Can't you use a loop and then stuff the timers into an NSMutableArray or
NSMutableDictionary to access?
On Thu, Sep 29, 2011 at 5:47 PM, Tom Hohensee <email@hidden>wrote:
> 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
>
_______________________________________________
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