• 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: using performSelectorInBackground
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using performSelectorInBackground


  • Subject: Re: using performSelectorInBackground
  • From: "Rick C." <email@hidden>
  • Date: Tue, 16 Jun 2009 18:53:20 -0700 (PDT)

thank you very much i believe i got it working ok now.

rick





________________________________
From: Nick Zitzmann <email@hidden>
To: Rick C. <email@hidden>
Cc: email@hidden
Sent: Wednesday, June 17, 2009 12:59:22 AM
Subject: Re: using performSelectorInBackground


On Jun 16, 2009, at 10:53 AM, Rick C. wrote:

> + (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds target:(id)target selector:(SEL)aSelectoruserInfo:(id)userInfo repeats:(BOOL)repeats
>
> however i need to use a separate thread for other reasons and i have now placed a call to my nstimer method from inside of my nsobject performSelectorInBackground selector and it no longer gets called.  i'm just learning about multi-threading and the performSelectorInBackground method is simple and works for me except for the call to my nstimer method.  i'm sure there's a reason why.  any thoughts?


There is; +scheduledTimerWithTimeInterval: schedules the timer in the thread's run loop. If the thread never runs its run loop, then nothing happens. You probably want to schedule the timer in the main run loop instead.

Nick Zitzmann
<http://www.chronosnet.com/>



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >using performSelectorInBackground (From: "Rick C." <email@hidden>)
 >Re: using performSelectorInBackground (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Notification/callback of successful CGEventPost?
  • Next by Date: Re: to NIB or not to NIB
  • Previous by thread: Re: using performSelectorInBackground
  • Next by thread: Bindings and nested preferences
  • Index(es):
    • Date
    • Thread