• 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: 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


  • Follow-Ups:
    • Re: perform ... afterDelay?
      • From: goessly <email@hidden>
References: 
 >perform ... afterDelay? (From: goessly <email@hidden>)
 >Re: perform ... afterDelay? (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: Checkboxes in Table Views
  • Next by Date: Re: Custom Objects in an NSTextView
  • Previous by thread: Re: perform ... afterDelay?
  • Next by thread: Re: perform ... afterDelay?
  • Index(es):
    • Date
    • Thread