O'Reilly logo

Advanced Mac OS X Programming: The Big Nerd Ranch Guide by Mark Dalrymple

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

NSTask

The NSTask object is used to create and control new processes. When the process ends, the object will post an NSTaskDidTerminateNotification notification. Before creating (or launching) the new process, you will set the attributes of the new process with these methods:

-​ ​(​v​o​i​d​)​s​e​t​L​a​u​n​c​h​P​a​t​h​:​ ​(​N​S​S​t​r​i​n​g​ ​*​)​p​a​t​h​

Sets the path to the code that will be executed when the process is created.

-​ ​(​v​o​i​d​)​s​e​t​A​r​g​u​m​e​n​t​s​:​ ​(​N​S​A​r​r​a​y​ ​*​)​a​r​g​u​m​e​n​t​s​

Takes an array of strings that will be the arguments to the program.

-​ ​(​v​o​i​d​)​s​e​t​E​n​v​i​r​o​n​m​e​n​t​:​ ​(​N​S​D​i​c​t​i​o​n​a​r​y​ ​*​)​d​i​c​t​

You can use this to set the environment variables. If unset, the environment ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required