谢谢您的帮助。这个执行命令的结果显示在我的 Xcode 控制台中。让命令结果显示在 NSTextView 中的最佳方法是什么?
NSString *commandToRun = @"~/Library/webREF/ffmpeg -nostats -i ~/Desktop/input.wav - filter_complex ebur128 -f null -";
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/bin/sh"];
NSArray *arguments = [NSArray arrayWithObjects:
@"-c" ,
[NSString stringWithFormat:@"%@", commandToRun],
nil];
NSLog(@"run command: %@",commandToRun);
[task setArguments: arguments];
NSPipe *pipe;
pipe = [NSPipe pipe];
[task setStandardOutput: pipe];
NSFileHandle *file;
file = [pipe fileHandleForReading];
[task launch];