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
Share this Page URL
Help

All About indexPaths

Table views describe their layouts in terms of instances of the NSIndexPath class. Technically, these are representations of paths to nodes within a collection of nested arrays.

However, that’s an extremely complicated description of what NSIndexPath objects are in the context of tableViews, so I’d stick to thinking of them in much more simple terms. As far as a tableView is concerned, an indexPath has two properties: a section and a row, shown in Figure 3–6. Both of these are instances of NSUIntegers.

images

Figure 3–6. indexPath sections and rows

As you can see, the table uses indexPaths to identify sections and rows. The iPhone Simulator is running Apple’s The Elements sample code, and it’s scrolled down to the elements beginning with the letter D.


  

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