Reading data from an NSTask
Reading data from an NSTask
- Subject: Reading data from an NSTask
- From: Ken Tozier <email@hidden>
- Date: Mon, 4 Jul 2005 12:50:47 -0400
Hi
I created an NSTask to run nibtool and am seeing the result in the
run log, but so far haven't had any luck at pulling the data out of
the task. Anyone see the problem in the below snippet?
NSTask *testTask1 = [NSTask launchedTaskWithLaunchPath: @"/
usr/bin/nibtool"
arguments: [NSArray
arrayWithObjects: @"-a", @"/Users/kentozier/Desktop/TestNib.nib", nil]];
// if I step through in the debugger, it hangs on the next line.
// The run log however shows that the nib data exists somewhere as it
get printed.
NSData *test1Data = [[testTask1 standardOutput]
readDataToEndOfFile];
NSString *testString = [[NSString alloc] initWithData: test1Data
encoding: NSUnicodeStringEncoding];
// the code never seems to make it to here
NSLog(@"standard output = %@", testString);
Thanks
Ken
_______________________________________________
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