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 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.