Class: UITableView

Inherits:
UIScrollView show all

Overview

An instance of UITableView (or simply, a table view) is a means for displaying and editing hierarchical lists of information.

Instance Attribute Summary (collapse)

Attributes inherited from UIScrollView

#alwaysBounceHorizontal, #alwaysBounceVertical, #bounces, #bouncesZoom, #canCancelContentTouches, #contentInset, #contentOffset, #contentSize, #decelerating, #decelerationRate, #delaysContentTouches, #directionalLockEnabled, #dragging, #indicatorStyle, #maximumZoomScale, #minimumZoomScale, #pagingEnabled, #panGestureRecognizer, #pinchGestureRecognizer, #scrollEnabled, #scrollIndicatorInsets, #scrollsToTop, #showsHorizontalScrollIndicator, #showsVerticalScrollIndicator, #tracking, #zoomBouncing, #zoomScale, #zooming

Attributes inherited from UIView

#alpha, #autoresizesSubviews, #autoresizingMask, #backgroundColor, #bounds, #center, #clearsContextBeforeDrawing, #clipsToBounds, #contentMode, #contentScaleFactor, #exclusiveTouch, #frame, #gestureRecognizers, #hidden, #layer, #multipleTouchEnabled, #opaque, #restorationIdentifier, #subviews, #superview, #tag, #transform, #userInteractionEnabled, #window

Attributes inherited from UIResponder

#inputAccessoryView, #inputView, #undoManager

Instance Method Summary (collapse)

Methods inherited from UIScrollView

#flashScrollIndicators, #scrollRectToVisible:animated:, #setContentOffset:animated:, #setZoomScale:animated:, #touchesShouldBegin:withEvent:inContentView:, #touchesShouldCancelInContentView:, #zoomToRect:animated:

Methods inherited from UIView

#addConstraint:, #addConstraints:, #addGestureRecognizer:, #addSubview:, #alignmentRectForFrame:, #alignmentRectInsets, animateWithDuration:animations:, animateWithDuration:animations:completion:, animateWithDuration:delay:options:animations:completion:, areAnimationsEnabled, beginAnimations:context:, #bringSubviewToFront:, commitAnimations, #constraints, #constraintsAffectingLayoutForAxis:, #contentCompressionResistancePriorityForAxis:, #contentHuggingPriorityForAxis:, #convertPoint:fromView:, #convertPoint:toView:, #convertRect:fromView:, #convertRect:toView:, #decodeRestorableStateWithCoder:, #didAddSubview:, #didMoveToSuperview, #didMoveToWindow, #drawRect:, #drawRect:forViewPrintFormatter:, #encodeRestorableStateWithCoder:, #endEditing:, #exchangeSubviewAtIndex:withSubviewAtIndex:, #exerciseAmbiguityInLayout, #frameForAlignmentRect:, #gestureRecognizerShouldBegin:, #hasAmbiguousLayout, #hitTest:withEvent:, #initWithFrame:, #insertSubview:aboveSubview:, #insertSubview:atIndex:, #insertSubview:belowSubview:, #intrinsicContentSize, #invalidateIntrinsicContentSize, #isDescendantOfView:, layerClass, #layoutIfNeeded, #layoutSubviews, #needsUpdateConstraints, #pointInside:withEvent:, #removeConstraint:, #removeConstraints:, #removeFromSuperview, #removeGestureRecognizer:, requiresConstraintBasedLayout, #sendSubviewToBack:, setAnimationBeginsFromCurrentState:, setAnimationCurve:, setAnimationDelay:, setAnimationDelegate:, setAnimationDidStopSelector:, setAnimationDuration:, setAnimationRepeatAutoreverses:, setAnimationRepeatCount:, setAnimationStartDate:, setAnimationTransition:forView:cache:, setAnimationWillStartSelector:, setAnimationsEnabled:, #setContentCompressionResistancePriority:forAxis:, #setContentHuggingPriority:forAxis:, #setNeedsDisplay, #setNeedsDisplayInRect:, #setNeedsLayout, #setNeedsUpdateConstraints, #setTranslatesAutoresizingMaskIntoConstraints:, #sizeThatFits:, #sizeToFit, #systemLayoutSizeFittingSize:, transitionFromView:toView:duration:options:completion:, transitionWithView:duration:options:animations:completion:, #translatesAutoresizingMaskIntoConstraints, #updateConstraints, #updateConstraintsIfNeeded, #viewForBaselineLayout, #viewPrintFormatter, #viewWithTag:, #willMoveToSuperview:, #willMoveToWindow:, #willRemoveSubview:

Methods inherited from UIResponder

#becomeFirstResponder, #canBecomeFirstResponder, #canPerformAction:withSender:, #canResignFirstResponder, #isFirstResponder, #motionBegan:withEvent:, #motionCancelled:withEvent:, #motionEnded:withEvent:, #nextResponder, #reloadInputViews, #remoteControlReceivedWithEvent:, #resignFirstResponder, #touchesBegan:withEvent:, #touchesCancelled:withEvent:, #touchesEnded:withEvent:, #touchesMoved:withEvent:

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (Boolean) allowsMultipleSelection

A Boolean value that determines whether users can select more than one row outside of editing mode. This property controls whether multiple rows can be selected simultaneously outside of editing mode. When the value of this property is YES, a check mark is placed next to each row that is tapped. Tapping the row again removes the check mark. If you call indexPathsForSelectedRows, you can get the index paths that identify the selected rows.The default value of this property is NO.

Returns:

  • (Boolean)

- (Boolean) allowsMultipleSelectionDuringEditing

A Boolean value that controls whether users can select more than one cell simultaneously in editing mode. The default value of this property is NO. If you it to YES, check marks appear next to selected rows in editing mode. In addition, UITableView does not query for editing styles when it goes into editing mode. If you call indexPathsForSelectedRows, you can get the index paths that identify the selected rows.

Returns:

  • (Boolean)

- (Boolean) allowsSelection

A Boolean value that determines whether users can select a row. If the value of this property is YES (the default), users can select rows. If you set it to NO, they cannot select rows. Setting this property affects cell selection only when the table view is not in editing mode. If you want to restrict selection of cells in editing mode, use allowsSelectionDuringEditing.

Returns:

  • (Boolean)

- (Boolean) allowsSelectionDuringEditing

A Boolean value that determines whether users can select cells while the receiver is in editing mode. If the value of this property is YES , users can select rows during editing. The default value is NO. If you want to restrict selection of cells regardless of mode, use allowsSelection.

Returns:

  • (Boolean)

- (UIView) backgroundView

The background view of the table view. A table view’s background view is automatically resized to match the size of the table view. This view is placed as a subview of the table view behind all cells , header views, and footer views.Assigning an opaque view to this property obscures the background color set on the table view itself.

Returns:

- (Object) dataSource

The object that acts as the data source of the receiving table view. The data source must adopt the UITableViewDataSource protocol. The data source is not retained.

Returns:

- (Object) delegate

The object that acts as the delegate of the receiving table view. The delegate must adopt the UITableViewDelegate protocol. The delegate is not retained.

Returns:

- (Boolean) editing

A Boolean value that determines whether the receiver is in editing mode. When the value of this property is YES , the table view is in editing mode: the cells of the table might show an insertion or deletion control on the left side of each cell and a reordering control on the right side, depending on how the cell is configured. (SeeUITableViewCell Class Reference for details.) Tapping a control causes the table view to invoke the data source method tableView:commitEditingStyle:forRowAtIndexPath:. The default value is NO.

Returns:

  • (Boolean)

- (Float) rowHeight

The height of each row (table cell) in the receiver. The row height is in points. You may set the row height for cells if the delegate doesn't implement the tableView:heightForRowAtIndexPath: method. If you do not explicitly set the row height, UITableView sets it to a standard value.There are performance implications to using tableView:heightForRowAtIndexPath: instead of rowHeight. Every time a table view is displayed, it calls tableView:heightForRowAtIndexPath: on the delegate for each of its rows, which can result in a significant performance problem with table views having a large number of rows (approximately 1000 or more).

Returns:

- (Float) sectionFooterHeight

The height of section footers in the receiving table view. This value is used only in section group tables, and only if the delegate doesn't implement the tableView:heightForFooterInSection: method.

Returns:

- (Float) sectionHeaderHeight

The height of section headers in the receiving table view. This value is used only if delegate the doesn't implement the tableView:heightForHeaderInSection: method.

Returns:

- (UIColor) sectionIndexColor

The color to use for the table view’s index text. Table views can display an index along the side of the view, making it easier for users to navigate the contents of the table quickly. This property specifies the color to use for text displayed in this region.

Returns:

- (Integer) sectionIndexMinimumDisplayRowCount

The number of table rows at which to display the index list on the right edge of the table. This property is applicable only to table views in the UITableViewStylePlain style. The default value is NSIntegerMax.

Returns:

- (UIColor) sectionIndexTrackingBackgroundColor

The color to use for the table view’s index background area. Table views can display an index along the side of the view, making it easier for users to navigate the contents of the table quickly. This property specifies the color to display in the background of the index when the user drags a finger through it.

Returns:

- (UIColor) separatorColor

The color of separator rows in the table view. The default color is gray.

Returns:

- (UITableViewCellSeparatorStyle) separatorStyle

The style for table cells used as separators. The value of this property is one of the separator-style constants described in UITableViewCell Class Reference class reference. UITableView uses this property to set the separator style on the cell returned from the delegate in tableView:cellForRowAtIndexPath:.

- (UITableViewStyle) style (readonly)

Returns the style of the receiver. (read-only) See “Table View Style” for descriptions of the constants used to specify table-view style.

Returns:

- (UIView) tableFooterView

Returns an accessory view that is displayed below the table. The default value is nil. The table footer view is different from a section footer.

Returns:

- (UIView) tableHeaderView

Returns an accessory view that is displayed above the table. The default value is nil. The table header view is different from a section header.

Returns:

Instance Method Details

- (Object) beginUpdates

Begin a series of method calls that insert, delete, or select rows and sections of the receiver. Call this method if you want subsequent insertions, deletion, and selection operations (for example, cellForRowAtIndexPath: and indexPathsForVisibleRows) to be animated simultaneously. This group of methods must conclude with an invocation of endUpdates. These method pairs can be nested. If you do not make the insertion, deletion, and selection calls inside this block, table attributes such as row count might become invalid. You should not call reloadData within the group; if you call this method within the group, you will need to perform any animations yourself.

Returns:

- (UITableViewCell) cellForRowAtIndexPath(indexPath)

Returns the table cell at the specified index path.

Parameters:

  • indexPath (NSIndexPath)

    The index path locating the row in the receiver.

Returns:

  • (UITableViewCell)

    An object representing a cell of the table or nil if the cell is not visible or indexPath is out of range.

- (Object) deleteRowsAtIndexPaths(indexPaths, withRowAnimation:animation)

Deletes the rows specified by an array of index paths, with an option to animate the deletion. Note the behavior of this method when it is called in an animation block defined by the beginUpdates and endUpdates methods. UITableView defers any insertions of rows or sections until after it has handled the deletions of rows or sections. This happens regardless of ordering of the insertion and deletion method calls. This is unlike inserting or removing an item in a mutable array, where the operation can affect the array index used for the successive insertion or removal operation. For more on this subject, see “Batch Insertion and Deletion of Rows and Sections” in Table View Programming Guide for iOS.

Parameters:

  • indexPaths (Array)

    An array of NSIndexPath objects identifying the rows to delete.

  • animation (UITableViewRowAnimation)

    A constant that indicates how the deletion is to be animated, for example, fade out or slide out from the bottom. See “Table Cell Insertion and Deletion Animation” for descriptions of these constants.

Returns:

- (Object) deleteSections(sections, withRowAnimation:animation)

Deletes one or more sections in the receiver, with an option to animate the deletion. Note the behavior of this method when it is called in an animation block defined by the beginUpdates and endUpdates methods. UITableView defers any insertions of rows or sections until after it has handled the deletions of rows or sections. This happens regardless of ordering of the insertion and deletion method calls. This is unlike inserting or removing an item in a mutable array, where the operation can affect the array index used for the successive insertion or removal operation. For more on this subject, see “Batch Insertion and Deletion of Rows and Sections” in Table View Programming Guide for iOS.

Parameters:

  • sections (NSIndexSet)

    An index set that specifies the sections to delete from the receiving table view. If a section exists after the specified index location, it is moved up one index location.

  • animation (UITableViewRowAnimation)

    A constant that either specifies the kind of animation to perform when deleting the section or requests no animation. See “Table Cell Insertion and Deletion Animation” for descriptions of the constants.

Returns:

- (Object) dequeueReusableCellWithIdentifier(identifier)

Returns a reusable table-view cell object located by its identifier. For performance reasons, a table view’€™s data source should generally reuse UITableViewCell objects when it assigns cells to rows in its tableView:cellForRowAtIndexPath: method. A table view maintains a queue or list of UITableViewCell objects that the data source has marked for reuse. Call this method from your data source object when asked to provide a new cell for the table view. This method dequeues an existing cell if one is available or creates a new one using the class or nib file you previously registered. If no cell is available for reuse and you did not register a class or nib file, this method returns nil. If you registered a class for the specified identifier and a new cell must be created, this method initializes the cell by calling its initWithStyle:reuseIdentifier: method. For nib-based cells, this method loads the cell object from the provided nib file. If an existing cell was available for reuse, this method calls the cell’s prepareForReuse method instead.

Parameters:

  • identifier (String)

    A string identifying the cell object to be reused. This parameter must not be nil.

Returns:

  • (Object)

    A UITableViewCell object with the associated identifier or nil if no such object exists in the reusable-cell queue.

- (Object) dequeueReusableCellWithIdentifier(identifier, forIndexPath:indexPath)

Returns a reusable table-view cell object for the specified reuse identifier. For performance reasons, a table view’€™s data source should generally reuse UITableViewCell objects when it assigns cells to rows in its tableView:cellForRowAtIndexPath: method. A table view maintains a queue or list of UITableViewCell objects that the data source has marked for reuse. Call this method from your data source object when asked to provide a new cell for the table view. This method dequeues an existing cell if one is available or creates a new one based on the class or nib file you previously registered.Important: You must register a class or nib file using the registerNib:forCellReuseIdentifier: or registerClass:forCellReuseIdentifier: method before calling this method. If you registered a class for the specified identifier and a new cell must be created, this method initializes the cell by calling its initWithStyle:reuseIdentifier: method. For nib-based cells, this method loads the cell object from the provided nib file. If an existing cell was available for reuse, this method calls the cell’s prepareForReuse method instead.

Parameters:

  • identifier (String)

    A string identifying the cell object to be reused. This parameter must not be nil.

  • indexPath (NSIndexPath)

    The index path specifying the location of the cell. The data source receives this information when it is asked for the cell and should just pass it along. This method uses the index path to perform additional configuration based on the cell’s position in the table view.

Returns:

  • (Object)

    A UITableViewCell object with the associated reuse identifier. This method always returns a valid cell.

- (Object) dequeueReusableHeaderFooterViewWithIdentifier(identifier)

Returns a reusable header or footer view located by its identifier. For performance reasons, a table view’€™s delegate should generally reuse UITableViewHeaderFooterView objects when it is asked to provide them. A table view maintains a queue or list of UITableViewHeaderFooterView objects that the table view’s delegate has marked for reuse. It marks a view for reuse by assigning it a reuse identifier when it creates it (that is, in the initWithReuseIdentifier: method of UITableViewHeaderFooterView). You can use this method to access specific template header and footer views that you previously created. You can access a view’€™s reuse identifier through its reuseIdentifier property.

Parameters:

  • identifier (String)

    A string identifying the header or footer view to be reused. This parameter must not be nil.

Returns:

- (Object) deselectRowAtIndexPath(indexPath, animated:animated)

Deselects a given row identified by index path, with an option to animate the deselection. Calling this method does not cause the delegate to receive a tableView:willSelectRowAtIndexPath: or tableView:didSelectRowAtIndexPath: message, nor will it send UITableViewSelectionDidChangeNotification notifications to observers.Calling this method does not cause any scrolling to the deselected row.

Parameters:

  • indexPath (NSIndexPath)

    An index path identifying a row in the receiver.

  • animated (Boolean)

    YES if you want to animate the deselection and NO if the change should be immediate.

Returns:

- (Object) endUpdates

Conclude a series of method calls that insert, delete, select, or reload rows and sections of the receiver. You call this method to bracket a series of method calls that began with beginUpdates and that consist of operations to insert, delete, select, and reload rows and sections of the table view. When you call endUpdates, UITableView animates the operations simultaneously. Invocations of beginUpdates and endUpdates can be nested. If you do not make the insertion, deletion, and selection calls inside this block, table attributes such as row count might become invalid.

Returns:

- (UITableViewHeaderFooterView) footerViewForSection(section)

Returns the footer view associated with the specified section.

Parameters:

  • section (Integer)

    An index number that identifies a section of the table. Table views in a plain style have a section index of zero.

Returns:

- (UITableViewHeaderFooterView) headerViewForSection(section)

Returns the header view associated with the specified section.

Parameters:

  • section (Integer)

    An index number that identifies a section of the table. Table views in a plain style have a section index of zero.

Returns:

- (NSIndexPath) indexPathForCell(cell)

Returns an index path representing the row and section of a given table-view cell.

Parameters:

Returns:

  • (NSIndexPath)

    An index path representing the row and section of the cell or nil if the index path is invalid.

- (NSIndexPath) indexPathForRowAtPoint(point)

Returns an index path identifying the row and section at the given point.

Parameters:

  • point (CGPoint)

    A point in the local coordinate system of the receiver (the table view’€™s bounds).

Returns:

  • (NSIndexPath)

    An index path representing the row and section associated with point or nil if the point is out of the bounds of any row.

- (NSIndexPath) indexPathForSelectedRow

Returns an index path identifying the row and section of the selected row. If there are multiple selections, this method returns the first index-path object in the array of row selections; this object has the lowest index values for section and row.

Returns:

  • (NSIndexPath)

    An index path identifying the row and section indexes of the selected row or nil if the index path is invalid.

- (Array) indexPathsForRowsInRect(rect)

An array of index paths each representing a row enclosed by a given rectangle.

Parameters:

  • rect (CGRect)

    A rectangle defining an area of the table view in local coordinates.

Returns:

  • (Array)

    An array of NSIndexPath objects each representing a row and section index identifying a row within rect. Returns an empty array if there aren’t any rows to return.

- (Array) indexPathsForSelectedRows

Returns the index paths represented the selected rows.

Returns:

  • (Array)

    An array of index-path objects each identifying a row through its section and row index. Returns nil if there are no selected rows.

- (Array) indexPathsForVisibleRows

Returns an array of index paths each identifying a visible row in the receiver.

Returns:

  • (Array)

    An array of NSIndexPath objects each representing a row index and section index that together identify a visible row in the table view. Returns nil if no rows are visible.

- (Object) initWithFrame(frame, style:style)

Initializes and returns a table view object having the given frame and style. You must specify the style of a table view when you create it and you cannot thereafter modify the style. If you initialize the table view with the UIView method initWithFrame:, the UITableViewStylePlain style is used as a default.

Parameters:

  • frame (CGRect)

    A rectangle specifying the initial location and size of the table view in its superview’€™s coordinates. The frame of the table view changes as table cells are added and deleted.

  • style (UITableViewStyle)

    A constant that specifies the style of the table view. See “Table View Style” for descriptions of valid constants.

Returns:

  • (Object)

    Returns an initialized UITableView object or nil if the object could not be successfully initialized.

- (Object) insertRowsAtIndexPaths(indexPaths, withRowAnimation:animation)

Inserts rows in the receiver at the locations identified by an array of index paths, with an option to animate the insertion. UITableView calls the relevant delegate and data source methods immediately afterwards to get the cells and other content for visible cells.Note the behavior of this method when it is called in an animation block defined by the beginUpdates and endUpdates methods. UITableView defers any insertions of rows or sections until after it has handled the deletions of rows or sections. This happens regardless of ordering of the insertion and deletion method calls. This is unlike inserting or removing an item in a mutable array, where the operation can affect the array index used for the successive insertion or removal operation. For more on this subject, see “Batch Insertion and Deletion of Rows and Sections” in Table View Programming Guide for iOS.

Parameters:

  • indexPaths (Array)

    An array of NSIndexPath objects each representing a row index and section index that together identify a row in the table view.

  • animation (UITableViewRowAnimation)

    A constant that either specifies the kind of animation to perform when inserting the cell or requests no animation. See “Table Cell Insertion and Deletion Animation” for descriptions of the constants.

Returns:

- (Object) insertSections(sections, withRowAnimation:animation)

Inserts one or more sections in the receiver, with an option to animate the insertion. UITableView calls the relevant delegate and data source methods immediately afterwards to get the cells and other content for visible cells.Note the behavior of this method when it is called in an animation block defined by the beginUpdates and endUpdates methods. UITableView defers any insertions of rows or sections until after it has handled the deletions of rows or sections. This happens regardless of ordering of the insertion and deletion method calls. This is unlike inserting or removing an item in a mutable array, where the operation can affect the array index used for the successive insertion or removal operation. For more on this subject, see “Batch Insertion and Deletion of Rows and Sections” in Table View Programming Guide for iOS.

Parameters:

  • sections (NSIndexSet)

    An index set that specifies the sections to insert in the receiving table view. If a section already exists at the specified index location, it is moved down one index location.

  • animation (UITableViewRowAnimation)

    A constant that indicates how the insertion is to be animated, for example, fade in or slide in from the left. See “Table Cell Insertion and Deletion Animation” for descriptions of these constants.

Returns:

- (Object) moveRowAtIndexPath(indexPath, toIndexPath:newIndexPath)

Moves the row at a specified location to a destination location. You can combine row-move operations with row-insertion and row-deletion operations within a beginUpdates–endUpdates block to have all changes occur together as a single animation. Unlike the row-insertion and row-deletion methods, this method does not take an animation parameter. For rows that are moved, the moved row animates straight from the starting position to the ending postion. Also unlike the other methods, this method allows only one row to be moved per call. If you want multiple rows moved, you can call this method repeatedly within a beginUpdates–endUpdates block.

Parameters:

  • indexPath (NSIndexPath)

    An index path identifying the row to move.

  • newIndexPath (NSIndexPath)

    An index path identifying the row that is the destination of the row at indexPath. The existing row at that location slides up or down to an adjoining index position to make room for it.

Returns:

- (Object) moveSection(section, toSection:newSection)

Moves a section to a new location in the table view. You can combine section-move operations with section-insertion and section-deletion operations within a beginUpdates–endUpdates block to have all changes occur together as a single animation. Unlike the section-insertion section row-deletion methods, this method does not take an animation parameter. For sections that are moved, the moved section animates straight from the starting position to the ending postion. Also unlike the other methods, this method allows only one section to be moved per call. If you want multiple section moved, you can call this method repeatedly within a beginUpdates–endUpdates block.

Parameters:

  • section (Integer)

    The index of the section to move.

  • newSection (Integer)

    The index in the table view that is the destination of the move for the section. The existing section at that location slides up or down to an adjoining index position to make room for it.

Returns:

- (Integer) numberOfRowsInSection(section)

Returns the number of rows (table cells) in a specified section. UITableView gets the value returned by this method from its data source and caches it.

Parameters:

  • section (Integer)

    An index number that identifies a section of the table. Table views in a plain style have a section index of zero.

Returns:

  • (Integer)

    The number of rows in the section.

- (Integer) numberOfSections

Returns the number of sections for the receiver. UITableView gets the value returned by this method from its data source and caches it.

Returns:

  • (Integer)

    The number of sections in the table view.

- (CGRect) rectForFooterInSection(section)

Returns the drawing area for the footer of the specified section.

Parameters:

  • section (Integer)

    An index number identifying a section of the table view. Plain-style table views always have a section index of zero.

Returns:

  • (CGRect)

    A rectangle defining the area in which the table view draws the section footer.

- (CGRect) rectForHeaderInSection(section)

Returns the drawing area for the header of the specified section.

Parameters:

  • section (Integer)

    An index number identifying a section of the table view. Plain-style table views always have a section index of zero.

Returns:

  • (CGRect)

    A rectangle defining the area in which the table view draws the section header.

- (CGRect) rectForRowAtIndexPath(indexPath)

Returns the drawing area for a row identified by index path.

Parameters:

  • indexPath (NSIndexPath)

    An index path object that identifies a row by its index and its section index.

Returns:

  • (CGRect)

    A rectangle defining the area in which the table view draws the row or CGRectZero if indexPath is invalid.

- (CGRect) rectForSection(section)

Returns the drawing area for a specified section of the receiver.

Parameters:

  • section (Integer)

    An index number identifying a section of the table view. Plain-style table views always have a section index of zero.

Returns:

  • (CGRect)

    A rectangle defining the area in which the table view draws the section.

- (Object) registerClass(cellClass, forCellReuseIdentifier:identifier)

Registers a class for use in creating new table cells. Prior to dequeueing any cells, call this method or the registerNib:forCellReuseIdentifier: method to tell the table view how to create new cells. If a cell of the specified type is not currently in a reuse queue, the table view uses the provided information to create a new cell object automatically.If you previously registered a class or nib file with the same reuse identifier, the class you specify in the cellClass parameter replaces the old entry. You may specify nil for cellClass if you want to unregister the class from the specified reuse identifier.

Parameters:

  • cellClass (Class)

    The class of a cell that you want to use in the table.

  • identifier (String)

    The reuse identifier for the cell. This parameter must not be nil and must not be an empty string.

Returns:

- (Object) registerClass(aClass, forHeaderFooterViewReuseIdentifier:identifier)

Registers a class for use in creating new table header or footer views. Prior to dequeueing any header or footer views, call this method or the registerNib:forHeaderFooterViewReuseIdentifier: method to tell the table view how to create new instances of your views. If a view of the specified type is not currently in a reuse queue, the table view uses the provided information to create a one automatically.If you previously registered a class or nib file with the same reuse identifier, the class you specify in the cellClass parameter replaces the old entry. You may specify nil for cellClass if you want to unregister the class from the specified reuse identifier.

Parameters:

  • aClass (Class)

    The class of a header or footer view that you want to use in the table.

  • identifier (String)

    The reuse identifier for the header or footer view. This parameter must not be nil and must not be an empty string.

Returns:

- (Object) registerNib(nib, forCellReuseIdentifier:identifier)

Registers a nib object containing a cell with the table view under a specified identifier. Prior to dequeueing any cells, call this method or the registerClass:forCellReuseIdentifier: method to tell the table view how to create new cells. If a cell of the specified type is not currently in a reuse queue, the table view uses the provided information to create a new cell object automatically. If you previously registered a class or nib file with the same reuse identifier, the nib you specify in the nib parameter replaces the old entry. You may specify nil for nib if you want to unregister the nib from the specified reuse identifier.

Parameters:

  • nib (UINib)

    A nib object that specifies the nib file to use to create the cell. This parameter cannot be nil.

  • identifier (String)

    The reuse identifier for the cell. This parameter must not be nil and must not be an empty string.

Returns:

- (Object) registerNib(nib, forHeaderFooterViewReuseIdentifier:identifier)

Registers a nib object containing a header or footer with the table view under a specified identifier. Prior to dequeueing any header or footer views, call this method or the registerClass:forHeaderFooterViewReuseIdentifier: method to tell the table view how to create new instances of your views. If a view of the specified type is not currently in a reuse queue, the table view uses the provided information to create a new one automatically. If you previously registered a class or nib file with the same reuse identifier, the nib you specify in the nib parameter replaces the old entry. You may specify nil for nib if you want to unregister the nib from the specified reuse identifier.

Parameters:

  • nib (UINib)

    A nib object that specifies the nib file to use to create the header or footer view. This parameter cannot be nil.

  • identifier (String)

    The reuse identifier for the header or footer view. This parameter must not be nil and must not be an empty string.

Returns:

- (Object) reloadData

Reloads the rows and sections of the receiver. Call this method to reload all the data that is used to construct the table, including cells, section headers and footers, index arrays, and so on. For efficiency, the table view redisplays only those rows that are visible. It adjusts offsets if the table shrinks as a result of the reload. The table view’€™s delegate or data source calls this method when it wants the table view to completely reload its data. It should not be called in the methods that insert or delete rows, especially within an animation block implemented with calls to beginUpdates and endUpdates

Returns:

- (Object) reloadRowsAtIndexPaths(indexPaths, withRowAnimation:animation)

Reloads the specified rows using a certain animation effect. Reloading a row causes the table view to ask its data source for a new cell for that row. The table animates that new cell in as it animates the old row out. Call this method if you want to alert the user that the value of a cell is changing. If, however, notifying the user is not important—that is, you just want to change the value that a cell is displaying—you can get the cell for a particular row and set its new value.When this method is called in an animation block defined by the beginUpdates and endUpdates methods, it behaves similarly to deleteRowsAtIndexPaths:withRowAnimation:. The indexes that UITableView passes to the method are specified in the state of the table view prior to any updates. This happens regardless of ordering of the insertion, deletion, and reloading method calls within the animation block.

Parameters:

  • indexPaths (Array)

    An array of NSIndexPath objects identifying the rows to reload.

  • animation (UITableViewRowAnimation)

    A constant that indicates how the reloading is to be animated, for example, fade out or slide out from the bottom. See “Table Cell Insertion and Deletion Animation” for descriptions of these constants.The animation constant affects the direction in which both the old and the new rows slide. For example, if the animation constant is UITableViewRowAnimationRight, the old rows slide out to the right and the new cells slide in from the right.

Returns:

- (Object) reloadSectionIndexTitles

Reloads the items in the index bar along the right side of the table view. This method gives you a way to update the section index after inserting or deleting sections without having to reload the whole table.

Returns:

- (Object) reloadSections(sections, withRowAnimation:animation)

Reloads the specified sections using a given animation effect. Calling this method causes the table view to ask its data source for new cells for the specified sections. The table view animates the insertion of new cells in as it animates the old cells out. Call this method if you want to alert the user that the values of the designated sections are changing. If, however, you just want to change values in cells of the specified sections without alerting the user, you can get those cells and directly set their new values.When this method is called in an animation block defined by the beginUpdates and endUpdates methods, it behaves similarly to deleteSections:withRowAnimation:. The indexes that UITableView passes to the method are specified in the state of the table view prior to any updates. This happens regardless of ordering of the insertion, deletion, and reloading method calls within the animation block.

Parameters:

  • sections (NSIndexSet)

    An index set identifying the sections to reload.

  • animation (UITableViewRowAnimation)

    A constant that indicates how the reloading is to be animated, for example, fade out or slide out from the bottom. See “Table Cell Insertion and Deletion Animation” for descriptions of these constants.The animation constant affects the direction in which both the old and the new section rows slide. For example, if the animation constant is UITableViewRowAnimationRight, the old rows slide out to the right and the new cells slide in from the right.

Returns:

- (Object) scrollToNearestSelectedRowAtScrollPosition(scrollPosition, animated:animated)

Scrolls the table view so that the selected row nearest to a specified position in the table view is at that position.

Parameters:

  • scrollPosition (UITableViewScrollPosition)

    A constant that identifies a relative position in the receiving table view (top, middle, bottom) for the row when scrolling concludes. See “Table View Scroll Position” a descriptions of valid constants.

  • animated (Boolean)

    YES if you want to animate the change in position, NO if it should be immediate.

Returns:

- (Object) scrollToRowAtIndexPath(indexPath, atScrollPosition:scrollPosition, animated:animated)

Scrolls the receiver until a row identified by index path is at a particular location on the screen. Invoking this method does not cause the delegate to receive a scrollViewDidScroll: message, as is normal for programmatically-invoked user interface operations.

Parameters:

  • indexPath (NSIndexPath)

    An index path that identifies a row in the table view by its row index and its section index.

  • scrollPosition (UITableViewScrollPosition)

    A constant that identifies a relative position in the receiving table view (top, middle, bottom) for row when scrolling concludes. See “Table View Scroll Position” a descriptions of valid constants.

  • animated (Boolean)

    YES if you want to animate the change in position, NO if it should be immediate.

Returns:

- (Object) selectRowAtIndexPath(indexPath, animated:animated, scrollPosition:scrollPosition)

Selects a row in the receiver identified by index path, optionally scrolling the row to a location in the receiver. Calling this method does not cause the delegate to receive a tableView:willSelectRowAtIndexPath: or tableView:didSelectRowAtIndexPath: message, nor will it send UITableViewSelectionDidChangeNotification notifications to observers.

Parameters:

  • indexPath (NSIndexPath)

    An index path identifying a row in the receiver.

  • animated (Boolean)

    YES if you want to animate the selection and any change in position, NO if the change should be immediate.

  • scrollPosition (UITableViewScrollPosition)

    A constant that identifies a relative position in the receiving table view (top, middle, bottom) for the row when scrolling concludes. See “Table View Scroll Position” a descriptions of valid constants.

Returns:

- (Object) setEditing(editing, animated:animate)

Toggles the receiver into and out of editing mode. When you call this method with the value of editing set to YES, the table view goes into editing mode by calling setEditing:animated: on each visible UITableViewCell object. Calling this method with editing set to NO turns off editing mode. In editing mode, the cells of the table might show an insertion or deletion control on the left side of each cell and a reordering control on the right side, depending on how the cell is configured. (See UITableViewCell Class Reference for details.) The data source of the table view can selectively exclude cells from editing mode by implementing tableView:canEditRowAtIndexPath:.

Parameters:

  • editing (Boolean)

    YES to enter editing mode, NO to leave it. The default value is NO .

  • animate (Boolean)

    YES to animate the transition to editing mode, NO to make the transition immediate.

Returns:

- (Array) visibleCells

Returns the table cells that are visible in the receiver.

Returns:

  • (Array)

    An array containing UITableViewCell objects, each representing a visible cell in the receiving table view.