【发布时间】:2016-08-25 14:47:30
【问题描述】:
我怎样才能做出这样的 if 语句:
if(the output of a nstask is equal to a specific string){
//do stuff over here
}
我正在运行NSTask,它会将来自它的数据放在 NSLog 中,但我怎么能不在那里显示它,而是将它存储为 NSString 或类似的东西
这就是我的任务的样子
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/usr/bin/csrutil"];
[task setArguments:@[ @"status" ]];
[task launch];
非常感谢任何帮助:)
【问题讨论】:
标签: objective-c cocoa nstask