Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

4.1. Arrays

The Rental Manager application, as it currently stands, stores a list of rental property details in a C-style array called properties. Inherently, nothing’s wrong with this technique, but it has some limitations. For example, when you declare a C-style array, you create it with a fixed number of elements, and it’s not possible to add or remove additional elements from the array without recompiling the application. Your rental management business may become more successful and require the ability to add new properties to the list at runtime.

The Foundation Kit provides a convenient array-like data structure called NSArray that overcomes this and other limitations. An NSArray is an ordered collection of objects, just like a C-style array, except it also has the ability to grow or shrink as required.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial