Re: Trying to capture standard error from an NSTask
Re: Trying to capture standard error from an NSTask
- Subject: Re: Trying to capture standard error from an NSTask
- From: j o a r <email@hidden>
- Date: Wed, 2 Mar 2005 09:31:25 +0100
On 2005-03-02, at 09.03, <email@hidden> wrote:
NSString* errorString = [[NSString alloc] initWithData:[errorReader
readDataToEndOfFile] encoding:nil];
if ([error length] != 0)
{
// do stuff
}
else // resume normal operation.
Is it just a typo that you call the string "error" and not
"errorString" here?
The thing is, when I run this in the debugger, it hits the line if
([error length] != 0) and goes into that block. But if I change it to
say [error length] == 0, it still enters the block! So my string
doesn't have a length but does at the same time?
Perhaps you should check that the string is != nil before you check the
length?
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden