• 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: Scheduling a selector when a thread completes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scheduling a selector when a thread completes


  • Subject: Re: Scheduling a selector when a thread completes
  • From: "Stephen J. Butler" <email@hidden>
  • Date: Wed, 29 Apr 2009 21:05:21 -0500

On Wed, Apr 29, 2009 at 8:55 PM,  <email@hidden> wrote:
> I tried calling NSObject's
>
>
> performSelector:(SEL) aSelector   withObject:(id) anArgument   afterDelay:( NSTimeInterval ) delay
>
>
>
> But the receiver's " aSelector"  method is never getting called. The only logical place to perform this scheduling is from inside the thread because only the thread knows when it is finished, but I'm having no luck getting the method to run.

You need to run the runloop in the thread in order for timers or the
performSelector* methods to work. Which changes your logic around a
lot.

One alternate way to get your goal is call
performSelectorOnMainThread:withObject:waitUntilDone: and pass it a
method that calls [self performSelector:@selector(updateDirectories)
withObject:self afterDelay:1.0] (or whatever delay you want).
_______________________________________________

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: 
 >Scheduling a selector when a thread completes (From: email@hidden)

  • Prev by Date: Re: Scheduling a selector when a thread completes
  • Next by Date: Re: Why is NSString->FSRef so hard?
  • Previous by thread: Re: Scheduling a selector when a thread completes
  • Next by thread: Re: Scheduling a selector when a thread completes
  • Index(es):
    • Date
    • Thread