Chapter    16

Working with Files

Most applications will need to deal with files stored on disk in one way or another. So far in this book, we really haven’t dealt much with this topic (except for a bit of discussion about Core Data and its data stores), so let’s remedy that right now. Cocoa actually includes several useful classes for dealing with files in a number of ways. There are classes that provide APIs mimicking operations the user can normally do in the Finder and others that represent a file in an abstract way. Still other classes have built-in functionality for reading and writing files. This chapter will provide an overview of how these mechanisms work.

Implicit File Access

Several classes in Cocoa, such as NSString, NSData, NSArray ...

Get Learn Cocoa on the Mac, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.