NSTask launch path not accessible

前端 未结 5 444
谎友^
谎友^ 2020-12-11 16:12

I am using the following code in my Cocoa project to call a script I made. The script is in the same folder as the project and even shows up under the \"Resources\" folder i

5条回答
  •  攒了一身酷
    2020-12-11 16:52

    This error occurs when the script itself is not marked as executable. Open a terminal window and go to where the script is in your project directory, then enter this:

    chmod +x script.sh
    

    Clean and build and you can use the script directly - this also means you can pass arguments to it.

提交回复
热议问题