NSTask waitForDataInBackgroundAndNotify and waitUntilExit

2008-05-12 Thread Torsten Curdt
I am trying to make use of waitForDataInBackgroundAndNotify when executing a script. I've setup the task like this NSTask *task = [[NSTask alloc] init]; [task setLaunchPath:path]; [task setArguments:args]; NSPipe *outPipe = [NSPipe pipe]; [task

Re: NSTask waitForDataInBackgroundAndNotify and waitUntilExit

2008-05-12 Thread Shawn Erickson
Your placement of waitUntilExit is blocking the runloop which needs to be running to service the background notifications you requested. If you want async behavior then you cannot wait on the task (at least not in the way you are currently attempting). Review the following code example...

Re: NSTask waitForDataInBackgroundAndNotify and waitUntilExit

2008-05-12 Thread Torsten Curdt
On May 12, 2008, at 23:04, Shawn Erickson wrote: Your placement of waitUntilExit is blocking the runloop which needs to be running to service the background notifications you requested. Ah ...I see. That makes sense. If you want async behavior then you cannot wait on the task (at least not