Chapter 15. Show Me the Data
In This Chapter
Creating and using property lists
How dictionaries work
Updating dictionaries and plists
Having a property list object (array) write itself to a file
In Chapter 1, I explain that a computer program is a set of instructions that perform operations on data. While this is what you have been steadily doing since Chapter 1 — coding statements that operate on data — all of the data you have been working with so far has been "hard coded" into the program.
Once you put on the user interface, of course, that will change. The user will be entering transactions, and you will be processing them, and probably storing both the transactions and the results as well. For example, you'll want to save all the credit card transactions to reconcile them against your statement when you get home, and you definitely want the ability to store what's left of your budget after a series of transactions so that every time you restart the program, you don't start with your original budget (well, it would be nice if you could do that, but I guess that's not realistic).
In this chapter, I will show you how to store what's left of your budget after a series of transactions to a file, and then read that file when the application starts up again. This will illustrate some of the ways you can save data. But before I show you that, I want to make you aware of another kind of data you need for your program, application-based data.
Understanding Application-Based Data
As I look at ...
Get Objective-C® For Dummies® 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.