Re: What to do with a NSTimer that has been invalidated ?
Re: What to do with a NSTimer that has been invalidated ?
- Subject: Re: What to do with a NSTimer that has been invalidated ?
- From: Alexei Kosut <email@hidden>
- Date: Mon, 7 Apr 2003 06:57:38 -0700
On Mon, Apr 07, 2003 at 11:28:16AM +0200, J?rome Foucher wrote:
>
I'm looking for a way to stop and later resume a NSTimer that fires
>
periodically.
>
>
If I call [timer invalidate], how can I "validate" it again ?
I don't think you can. Invalidating a timer makes it so it can never
fire again.
What you can do instead is set its fire date to [NSDate distantFuture]
to "invalidate" the timer, and then set its fire date to "now" (or now
plus its repeat interval) to "reactivate" it.
I've done this, and it works well.
--
Alexei Kosut <email@hidden> <
http://cs.stanford.edu/~akosut/>
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.