Chapter    3

Working with Object Collections

This chapter will help you work with arrays and dictionaries using the Foundation framework with Objective-C.

The recipes in this chapter will show you how to:

  • Create arrays using NSArray and NSMutableArray
  • Add, remove, and insert objects into arrays
  • Search and sort arrays
  • Use different procedures to iterate through arrays
  • Save array contents to the file system
  • Create dictionaries using NSDictionary and NSMutableDictionary
  • Add and remove objects from dictionaries
  • Use different procedures to iterate through dictionaries
  • Save dictionary contents to the file system
  • Create sets using NSSet and NSMutableSet
  • Compare sets based on their object contents
  • Use different procedures to iterate through sets

Get Objective-C Recipes: A Problem-Solution Approach now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.