• 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: Problems with NSTimer and NSRunLoop/CFRunLoop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with NSTimer and NSRunLoop/CFRunLoop


  • Subject: Re: Problems with NSTimer and NSRunLoop/CFRunLoop
  • From: Brendan Younger <email@hidden>
  • Date: Thu, 06 Jan 2005 20:45:21 -0600


On Jan 6, 2005, at 8:32 PM, John Stiles wrote:

Unnecessary how?
If you don't attach your timer to a run loop in a mode, it doesn't run, period.

True, but -[NSTimer scheduledTimerWithTimeInterval:target:selector:userInfo:repeats:] automatically adds itself to the current run loop for the default mode. -[NSTimer timerWithTimeInterval:etc.] doesn't add itself and needs to be added manually. The original poster was using -[NSTimer scheduledTimerWithTimeInterval:etc.].


To Mont Rothstein: if "performExpirationCheck:" is meant to be called while a modal window is up in your application, you need to add the timer to the run loop for NSModalPanelRunLoopMode since -[NSTimer scheduledTimerWithTimeInterval:] adds itself for only NSDefaultRunLoopMode.

Brendan Younger

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problems with NSTimer and NSRunLoop/CFRunLoop
      • From: Mont Rothstein <email@hidden>
References: 
 >Problems with NSTimer and NSRunLoop/CFRunLoop (From: Mont Rothstein <email@hidden>)
 >Re: Problems with NSTimer and NSRunLoop/CFRunLoop (From: John Stiles <email@hidden>)
 >Re: Problems with NSTimer and NSRunLoop/CFRunLoop (From: Brendan Younger <email@hidden>)
 >Re: Problems with NSTimer and NSRunLoop/CFRunLoop (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Problems with NSTimer and NSRunLoop/CFRunLoop
  • Next by Date: Cocoa programming-Add control at the run-time
  • Previous by thread: Re: Problems with NSTimer and NSRunLoop/CFRunLoop
  • Next by thread: Re: Problems with NSTimer and NSRunLoop/CFRunLoop
  • Index(es):
    • Date
    • Thread