Skip to Main Content
Cocoa Programming for Mac OS X, Third Edition
book

Cocoa Programming for Mac OS X, Third Edition

by Aaron Hillegass
May 2008
Intermediate to advanced content levelIntermediate to advanced
464 pages
8h 13m
English
Addison-Wesley Professional
Content preview from Cocoa Programming for Mac OS X, Third Edition

Chapter 34. NSTask

Each application that you have created is in fact a directory, and somewhere down in that directory is an executable file. To run an executable on a Unix machine, such as your Mac, a process is forked, and the new process executes the code in that file. Many executables are command line tools, and some are quite handy. This chapter shows you how to run command line tools from your Cocoa application by using the class NSTask.

NSTask is an easy-to-use wrapper for the Unix functions fork() and exec(). You give it a path to an executable and launch it. Many processes read data from standard-in and write to standard-out and standard-error. Your application can use NSTask to attach pipes to carry data to and from the external process. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

COCOA PROGRAMMING FOR MAC OS X SECOND EDITION

COCOA PROGRAMMING FOR MAC OS X SECOND EDITION

Aaron Hillegass

Publisher Resources

ISBN: 9780321562739Purchase book