Re: perform ... afterDelay?
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