Re: NSTask output reading problem
Re: NSTask output reading problem
- Subject: Re: NSTask output reading problem
- From: Ondra Cada <email@hidden>
- Date: Sat, 24 Apr 2004 13:32:07 +0200
On 24.4.2004, at 12:20, Jean Bovet wrote:
>
[task launch];
>
>
[taskOutput readInBackgroundAndNotify];
>
[errorOutput readInBackgroundAndNotify];
What about switching them? First schedule readInBackgroundAndNotify,
then launch the task. Otherwise, it looks about right -- such a code
works for me in may apps all right.
>
if (incomingData && [incomingData length]>0) {
This is unnecessary: thanks to ObjC smart design, "if ([incomingData
length]>0)" would work just as well. You need a separate check for nil
only in cases the method may return float, struct, or generally
anything unconvertible to int.
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.