• 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: To thread or not to thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: To thread or not to thread?


  • Subject: Re: To thread or not to thread?
  • From: email@hidden
  • Date: Mon, 30 Jan 2006 16:06:53 -0800

Actually, you should be able to do this using just NSRunloops - (void) performSelector:(SEL)aSelector target:(id)target argument:(id) anArgument order:(unsigned)order modes:(NSArray*)modes. Use that whenever your checkbox is checked, and then in the method that you're invoking, if the checkbox is still checked, call it again.

That avoids the overhead of allocating and managing an NSTimer. It also guarantees that your method will be called as fast as possible without blocking the runloop. There is the possibility of the method being enqueued multiple times, if the state of the checkbox changes rapidly, but only if you're changing it programmatically (I think). If nothing else, you could always use a BOOL somewhere to indicate whether you've already enqueued the message or not.

Wade
_______________________________________________
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: To thread or not to thread?
      • From: Markus Hitter <email@hidden>
References: 
 >To thread or not to thread? (From: Jeremy Hubbell <email@hidden>)
 >Re: To thread or not to thread? (From: Dado Colussi <email@hidden>)
 >Re: To thread or not to thread? (From: Andrew Thompson <email@hidden>)
 >Re: To thread or not to thread? (From: Dado Colussi <email@hidden>)
 >Re: To thread or not to thread? (From: Jeremy Hubbell <email@hidden>)

  • Prev by Date: Re: xcodes deployment
  • Next by Date: Re: KVC broken in 10.4.4 on Intel?
  • Previous by thread: Re: To thread or not to thread?
  • Next by thread: Re: To thread or not to thread?
  • Index(es):
    • Date
    • Thread