See Also: UITableViewDataSource
public abstract class UITableViewDataSource : NSObject, IUITableViewDataSource, IDisposable
Implementing UITableView often requires subclasses of both UITableViewDataSource and UITableViewDelegate to provide data and behavior for the table view. Xamarin.iOS provides a single class - UITableViewSource - so that only one class needs to be implemented.
The UITableViewDataSource class methods provide a table view with all the information it requires to display its data - such as informing it of the number of sections and rows, and what cell view to use for each row.
The universally-important function of UITableViewDataSource is to provide individual UITableViewCells in response to calls to UITableViewDataSource.GetCell. That call takes as arguments the UITableView in question and an NSIndexPath. That NSIndexPath is based, in turn, on calls to UITableViewDataSource.NumberOfSections and UITableViewDataSource.RowsInSection, so the application developer must, at a minimum, override these three functions. (The UITableView additionally calls UITableViewDelegate.GetHeightForRow and other layout-related methods for header and footer views and the application developer must override these as appropriate.)
Static tables may return references to pre-allocated UITableViewCells from calls to UITableViewDataSource.GetCell. Dynamic tables should use the UITableView's built-in cell reuse cache by calling UITableView.DequeueReusableCell. In iOS 6 and later, application developers should use UITableView.RegisterClassForCellReuse or UITableView.RegisterNibForCellReuse during initialization, in which case UITableView.DequeueReusableCell will instantiate new UITableViewCells as necessary. If application developers are targeting earlier iOS versions, their override of UITableViewDataSource.GetCell must check for an null return from UITableView.DequeueReusableCell and instantiate a UITableViewCell as necessary.
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0
The members of MonoTouch.UIKit.UITableViewDataSource are listed below.
See Also: NSObject
|Default constructor that initializes a new instance of this class with no parameters.|
|A constructor that initializes the object from the data stored in the unarchiver object.|
|Constructor to call on derived classes to skip initialization and merely allocate the object.|
|A constructor used when creating managed representations of unmanaged objects; Called by the runtime.|
Whether the row located at indexPath should be editable.
Whether the row located at indexPath can be moved to another location in the table view.
|CommitEditingStyle(UITableView, UITableViewCellEditingStyle, NSIndexPath)|
Commits the insertion or deletion of the specified row.
Called by the table view to get populate the row at indexPath with a cell view.
|MoveRow(UITableView, NSIndexPath, NSIndexPath)|
Called when a row has been moved so that the data source can 'implement' the changed row position that has been performed in the user interface. This ensures the data is kept in-sync with what is being displayed.
Returns the number of sections that are required to display the data.
Called by the table view to find out how many rows are to be rendered in the section specified by section.
|SectionFor(UITableView, String, Int32)|
Returns the index of the section with the given tableView and atIndex.
Returns an array of titles to be displayed as an index on the table view.
Called to populate the footer for the specified section.
Called to populate the header for the specified section.