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

19Using NSTask

In this section, you will learn:

  • how to create new processes using NSTask,

  • how to send data to the new process' standard in and read data from its standard out and standard error using NSPipe and NSFileHandle, and

  • how NSProcessInfo supplies the program with information about itself.

NSProcessInfo

Your application can access its own process information using the NSProcessInfo object. Here are some of the commonly used methods on NSProcessInfo:

+​ ​(​N​S​P​r​o​c​e​s​s​I​n​f​o​ ​*​)​p​r​o​c​e​s​s​I​n​f​o​

You will use this class method to get hold of the shared instance of NSProcessInfo for the current process.

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

Returns a dictionary containing all the environment variables ...

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