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

Creating an App that Creates a New Process

Unix systems have a program called sort that reads data from standard input, sorts it, and outputs it to standard output. You are going to write a program that invokes sort as a new process, writes data to its input, and reads data from its output. The user will type in an NSTextView, click a button to trigger the sort, and read the result in another NSTextView. It will look like Figure 19.1:

Figure 19.1  SortThem application running

SortThem application running

For the record, this is not how we would do a sort in a real application. The NSArray class has a couple of elegant ways to do sorting. This is just a simple example of using ...

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