O'Reilly logo

Learn Objective-C on the Mac: For OS X and iOS, Second Edition by Scott Knaster, Waqar Malik, 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

Chapter 17

File Loading and Saving

Many computer programs (applications) end up creating some kind of semi-permanent artifact of the user’s work. Maybe it’s an edited photo. Maybe it’s a chapter of a novel. Maybe it’s your band’s cover of “Free Bird.” In each of these cases, the user ends up with a saved file.

The standard C library provides function calls to create, read, and write files, such as open(), read(), write(), fopen(), and fread(). These functions are well documented elsewhere, so we won’t talk about them. Cocoa provides Core Data, which handles all this file stuff behind the scenes for you. We won’t be talking about this either.

So what does that leave us to discuss? Cocoa provides two general classes of file handling: property ...

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