Re: Scheduling a selector when a thread completes
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