On Apr 12, 2010, at 8:46 AM, Rasmus Skaarup wrote:
>> Try simplifying your app by eliminating the use of background threads. Or,
>> if you feel you must use background threads for long-running computation,
>> use them only for handling the data after receiving it. Do everything
>> involving l
> Try simplifying your app by eliminating the use of background threads. Or,
> if you feel you must use background threads for long-running computation, use
> them only for handling the data after receiving it. Do everything involving
> launching the task and initiating background reads of it
You could use MYTask, or at least look at how it’s implemented, instead of
writing your own code. NSTask is surprisingly tricky to use if you want to read
the task output.
http://bitbucket.org/snej/myutilities/src/tip/MYTask.h
—Jens___
Cocoa-dev mail
On Apr 11, 2010, at 3:18 PM, Rasmus Skaarup wrote:
> On 11/04/2010, at 21.17, Ken Thomases wrote:
>
>> On Apr 8, 2010, at 9:57 AM, Rasmus Skaarup wrote:
>
>>> [[NSNotificationCenter defaultCenter] addObserver:self
>>>
>>>
On 11/04/2010, at 21.17, Ken Thomases wrote:
> On Apr 8, 2010, at 9:57 AM, Rasmus Skaarup wrote:
>> [[NSNotificationCenter defaultCenter] addObserver:self
>>
>> selector:@selector(threadPipeReader:)
>>
On Apr 8, 2010, at 9:57 AM, Rasmus Skaarup wrote:
> I'm trying to execute a task in the background and parsing the output from
> the task along the way. However I get the NSTaskDidTerminateNotification
> before all the output from the task has been delivered by
> NSFileHandleReadCompletionNotif