I have been searching for days and hours for this, I have seen a lot of examples of this, but cannot figure out how NSTask works, let\'s say I wanted to exe
You could do something like:
NSTask *task = [[NSTask alloc] init]; [task setLaunchPath:@"/bin/bash"]; [task setArguments:@[ @"-c", @"/usr/bin/killall Dock" ]]; [task launch];
Exactly what launch path and arguments you provide are dictated by the command you want to run and its parameters.