• 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: perform ... afterDelay?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: perform ... afterDelay?


  • Subject: Re: perform ... afterDelay?
  • From: Marco Scheurer <email@hidden>
  • Date: Thu, 5 Jan 2006 10:51:10 +0100


On Jan 5, 2006, at 07:28, Nathan Day wrote:

[self performSelector:@selector(someSelector) withObject:nil afterDelay:0.04] might use a NSTimer anyway,

However in the loop as written this is irrelevant because since performSelector:withObject:afterDelay: returns immediatly the message will be sent a lot more faster than 25 times per second. You will then have too many stacked up messages that will be sent in succession, with no delay between them. This could be fixed using NSRunLoop performSelector:target:argument:order:modes: and cancelPerformSelector:target:argument: for instance, but this is really not what should be done in that case.


If timing is critical then maybe you should be using a thread since the timing is going to be screwed up if the NSRunLoop has called something else that has not returned in time to fire you timer, like handling user input.

Yes, maybe with a CVDisplayLink to give the beat.


Marco Scheurer Sen:te, Lausanne, Switzerland http://www.sente.ch

_______________________________________________
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


References: 
 >perform ... afterDelay? (From: goessly <email@hidden>)
 >Re: perform ... afterDelay? (From: Nathan Day <email@hidden>)

  • Prev by Date: TextEdit's sheets curiosity
  • Next by Date: RE: UNICODE from a WinTel box
  • Previous by thread: Re: perform ... afterDelay?
  • Next by thread: Core-Data Non-Standard Attributes
  • Index(es):
    • Date
    • Thread