0
도움 주셔서 감사합니다. 이 실행 된 명령의 결과는 내 Xcode 콘솔에 표시됩니다. 명령의 결과를 NSTextView에 표시하는 가장 좋은 방법은 무엇입니까?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];
감사하지만이 동작하지 않습니다. 또한 프로젝트는 ARC를 사용하도록 설정됩니다. – Paul
나는'ffmpg'가 없으므로 정확한 명령을 테스트 할 수는 없지만 stdOut에 출력되는 다른 명령은 나를 위해 작동합니다. –
다시 한번 감사드립니다. 명령은 예상대로 worx입니다. 콘솔 출력이 이것을 확인합니다. textView ...-Paul에 출력이 없습니다. – Paul