I have multiple run loops.

On the main thread I have [[NSRunLoop currentRunLoop] run];

On the sub threads for NSTask and NSPipe, I have 
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 1, YES);

If you are saying that you have to use NSRunLoop in order for it to work, get 
it working in my example and have the run loop stop running.

I tried multiple things as well.

[[NSRunLoop currentRunLoop] runUntilDate:[NSDate 
dateWithTimeIntervalSinceNow:1]];

I tried using CFRunLoopRun();
I tried using CFRunLoopStop(CFRunLoopGetCurrent()) to stop [[NSRunLoop 
currentRunLoop] run];

I am really getting nowhere. If you really think you know how to fix it, do so 
in the code and report back to me with working code. Don't make guess work as 
this has been bugging me for hours and I think I tried pretty much everything 
possible. I have not attempted to use c libraries to interact with the NSPipe.

I can confirm if you do not stop the run loop, it will get everything… However… 
I cannot do this as I do not know how much data I am receiving from the task.

Is there a way to have NSPipe read until it actually reaches the end of file? 
What I have tried so far doesn't seem to work.

Thanks for helping me with this crazy task.

On Jul 31, 2012, at 7:14 PM, Kyle Sluder <k...@ksluder.com> wrote:

> NSTask requires a running runloop. Your code is a plain-ol' Foundation
> tool and doesn't have a runloop.
> 
> I wouldn't be surprised if NSPipe has the same requirement.
> 
> --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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to