Re: perform ... afterDelay?
Re: perform ... afterDelay?
- Subject: Re: perform ... afterDelay?
- From: Marco Scheurer <email@hidden>
- Date: Wed, 4 Jan 2006 18:46:33 +0100
On Jan 4, 2006, at 15:37, Jeff LaMarche wrote:
Simplisticly put: (how) can I use that like this:
[self myCounter++ afterDelay:0.04]
You need to create a method that that you can call. [...]
Then, you can call these like so:
[self performSelector:@selector(incrementCounter) withObject:nil
afterDelay:0.04];
This is indeed how performSelector:withObject:afterDelay: works, but
this is also certainly NOT what is required if the orginal post is to
be believed.
email@hidden wrote:
while(myCounter < maxCounter)
{
do Stuff;
wait 0.04 seconds;
increment myCounter;
}
performSelector:withObject:afterDelay: returns immediatly, and using
it in the above loop will not have the results one might hope for.
What would be needed in such case to wait for .04 seconds is:
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate
dateWithTimeIntervalSinceNow:0.04]];
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