Skip to Content
Cocoa Programming for OS X: The Big Nerd Ranch Guide
book

Cocoa Programming for OS X: The Big Nerd Ranch Guide

by Aaron Hillegass, Adam Preble, Nate Chandler
April 2015
Intermediate to advanced
556 pages
17h 47m
English
Big Nerd Ranch Guides
Content preview from Cocoa Programming for OS X: The Big Nerd Ranch Guide

Asynchronous Reads

As mentioned in Chapter 23, the run loop is the object that waits for events, which may be keyboard, mouse, or timer events. These are all run loop data sources. You can also make a file handle a run loop data source.

In the next section, you are going to fork off a process that burps up data occasionally. You will attach a pipe to standardOutput, but instead of trying to read all the data from the file handle immediately, you will ask the file handle to read in the background and send a notification when data is ready.

You can use /sbin/ping to check whether you can make an IP connection to another machine. Try running it in Terminal:

$ ping -c10 www.bignerdranch.com PING www.bignerdranch.com (69.39.89.150): ...
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

Learning Cocoa with Objective-C, 4th Edition

Learning Cocoa with Objective-C, 4th Edition

Paris Buttfield-Addison, Jonathon Manning, Tim Nugent
Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy

Stefan Kaczmarek, Brad Lees, Gary Bennett, Mitch Fisher

Publisher Resources

ISBN: 9780134077130Purchase book