Chapter 15

File Loadingand Saving

most 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 file on a disk.

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? Cocoa provides two general classes of file handling: property lists and ...

Get Learn Objective-C on the Mac now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.