iPhone OS Reference Library Apple Developer Connection spyglass button

NSIndexPath UIKit Additions

Inherits from
Conforms to
Framework
/System/Library/Frameworks/UIKit.framework
Availability
Available in iPhone OS 2.0 and later.
Declared in
UITableView.h

Overview

The UIKit framework adds programming interfaces to the NSIndexPath class of the Foundation framework to facilitate the identification of rows and sections in UITableView objects.

The API consists of a class factory method and two properties. The indexPathForRow:inSection: method creates an NSIndexPath object from row and section index numbers. The properties return the row index number and the section index number from such objects.

Tasks

Creating an Index Path Object

Getting the Row and Section Indexes

Properties

For more about Objective-C properties, see “Properties” in The Objective-C Programming Language.

row

An index number identifying a row in a section of a table view. (read-only)

@property(readonly) NSUInteger row
Discussion

The section the row is in is identified by the value of section.

Availability
Related Sample Code
Declared In
UITableView.h

section

An index number identifying a section in a table view. (read-only)

@property(readonly) NSUInteger section
Availability
Related Sample Code
Declared In
UITableView.h

Class Methods

indexPathForRow:inSection:

Returns an index-path object initialized with the indexes of a specific row and section in a table view.

+ (NSIndexPath *)indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section

Parameters
row

An index number identifying a row in a UITableView object in a section identified by section.

section

An index number identifying a section in a UITableView object.

Return Value

An NSIndexPath object or nil if the object could not be created. The returned object is autoreleased.

Availability
Related Sample Code
Declared In
UITableView.h


Last updated: 2008-07-08

Did this document help you? Yes It's good, but... Not helpful...