On Thu, Sep 30, 2010 at 8:26 PM, Kunal Parmar <kunalpar...@gmail.com> wrote:
> I am using a NSTask in NSOperation. But I am not getting any notifications.
NSTask relies on a runloop. Since you have no control over what thread
your operation runs in, you can't run a runloop on your operation's
thread, and therefore cannot use NSTask in this manner.

You will need to spawn your NSTasks on the main thread (or at least a
thread you own, not one owned by NSOperationQueue or GCD). When you
get your -taskDidTerminate: notification *on the main thread*, you can
enqueue another operation to handle the result of the task completing.

--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to