• 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: Jeff LaMarche <email@hidden>
  • Date: Wed, 4 Jan 2006 09:37:14 -0500

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. It either needs to take no arguments, or what arguments it does take must be objects (like NSNumber), so something like this (typed in e-mail, usual disclaimers, yada yada)


- (void)incrementCounter
{
	myCounter++;
}

or

- (void)incrementCounterBy:(NSNumber *)amt
{
	myCount+=[amt intValue];
}

Then, you can call these like so:

[self performSelector:@selector(incrementCounter) withObject:nil afterDelay:0.04];

or

NSNumber *amt = [NSNumber numberWithInt:5];
[self performSelector:@selector(incrementCounter:) withObject:amt afterDelay:0.04];


Hope that helps...

Jeff
_______________________________________________
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? [solved]
      • From: goessly <email@hidden>
    • Re: perform ... afterDelay?
      • From: Marco Scheurer <email@hidden>
    • Re: perform ... afterDelay?
      • From: Andy Armstrong <email@hidden>
References: 
 >perform ... afterDelay? (From: goessly <email@hidden>)

  • Prev by Date: Re: perform ... afterDelay?
  • Next by Date: Re: How to execute the .app from the Terminal window
  • Previous by thread: Re: perform ... afterDelay?
  • Next by thread: Re: perform ... afterDelay?
  • Index(es):
    • Date
    • Thread