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.

Storing data in collections<br />

This chapter covers<br />

■<br />

■<br />

■<br />

■<br />

NSArray<br />

NSDictionary<br />

Storing nil and other special values in<br />

collections<br />

Boxing and unboxing non-object-based data<br />

Chapter 3 introduced the concept of object-oriented programming and demonstrated<br />

some of its advantages by using the services of the prebuilt NSString class,<br />

which provides common text manipulation and query-related functionality.<br />

A large part of Foundation Kit is concentrated on the storage of data in collection<br />

data structures with names such as arrays, dictionaries, sets, and hashmaps.<br />

These data structures allow you to efficiently collect, group, sort, and filter data in a<br />

way that’s convenient for the application at hand. Discussing these commonly used<br />

classes is what this chapter is all about.<br />

Let’s start by discussing how Foundation Kit improves upon a data structure<br />

you’re currently familiar with: a simple array.<br />

74

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

Saved successfully!

Ooh no, something went wrong!