Re: Reading return values from NSTask
Re: Reading return values from NSTask
- Subject: Re: Reading return values from NSTask
- From: j o a r <email@hidden>
- Date: Mon, 29 Dec 2003 00:26:48 +0100
On 2003-12-28, at 23.40, KLW wrote:
>
outString = [outString initWithData:inData
>
encoding:NSASCIIStringEncoding];
You have already allocated and initialized the "outString" string, so
you can't do it over and over again like this. Try something like this:
=====================================================
[task launch];
// [task waitUntilExit]; // Use this if you can
NSData *data;
while ((inData = [readHandle availableData]) && [inData length])
{
NSString *s = [[[NSString alloc] initWithData: inData encoding:
[NSString defaultCStringEncoding]] autorelease];
[outString appendString: s];
}
NSLog(outString);
=====================================================
What type of problems is it that you see?
j o a r
[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.