0

Thanks for the help. My code below works, returning results in the Console. I want to display the same results in a textView. Can't get it to work. Can anyone explain what I need to do?

Thanks.

-(IBAction)activateTask:(id)sender

{

NSURL *fileURL = [NSURL fileURLWithPath:sourceField.stringValue];
NSString *filePath= [fileURL path];

[soxTask setArguments:[NSArray arrayWithObjects:@"--show-progress", filePath, @"-n", @"stats" , nil]];
NSPipe *pipe;
pipe = [NSPipe pipe];
[soxTask setStandardOutput: pipe];

NSFileHandle *file;
file = [pipe fileHandleForReading];


[soxTask launch];
[soxTask waitUntilExit];

NSData *data;
data = [file readDataToEndOfFile];

NSString *string;
string = [[NSString alloc] initWithData: data
                               encoding: NSUTF8StringEncoding];

[textView setString:string];


///



}
Paul
  • 189
  • 10

1 Answers1

1

Try using -setStandardError: instead of -setStandardOutput:

Wil Shipley
  • 9,343
  • 35
  • 59