Cocoa/ Objective-C Shell Command Line Execution

后端 未结 3 1294
一向
一向 2020-12-02 21:03

This is probably a stupid question, but how can I execute a shell command from my Cocoa app?

I have the command as a string \"command\", but can easily manipulate da

3条回答
  •  时光说笑
    2020-12-02 21:43

    NSTask

    Using the NSTask class, your program can run another program as a subprocess and can monitor that program’s execution.

提交回复
热议问题