• 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: What to do with a NSTimer that has been invalidated ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >What to do with a NSTimer that has been invalidated ? (From: Jérome Foucher <email@hidden>)

  • Prev by Date: Re: custom NSRulerView and other related issues
  • Next by Date: Dragging an Image out of an NSTextView
  • Previous by thread: What to do with a NSTimer that has been invalidated ?
  • Next by thread: Re: What to do with a NSTimer that has been invalidated ?
  • Index(es):
    • Date
    • Thread