01.02.2014 Views

Objective-C Fundamentals

Objective-C Fundamentals

Objective-C Fundamentals

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

92 CHAPTER 4 Storing data in collections<br />

Figure 4.1 Adding a new Property List file to your project via the New File dialog. Watch<br />

out! The Property List file template is located in the Resource section, not in Cocoa Touch<br />

with the rest of the iOS-related templates.<br />

With the easily editable plist file populated and added to your project, you can now<br />

make the few minor code changes required to make use of it.<br />

The first change is to update the definition of the RootViewController class available<br />

in the RootViewController.h file to provide a place to store an NSDictionary containing<br />

the city-to-location mappings. You should end up with something like the following:<br />

@interface RootViewController : UITableViewController {<br />

NSDictionary *cityMappings;<br />

}<br />

Figure 4.2<br />

The graphical plist file editor available in Xcode whenever a plist file is selected

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!