正在学习看iOS官方开发文档,但有点看不懂,还望得到大家的指点,举个具体例子吧,我一个UIViewController作为UITableView的Delegate,看到文档说到conform UITableViewDataSource必须实现的tableView:cellForRowAtIndexPath方法,链接到该方法(如下),除了知道需要return cell外,余下的要怎么实现呢?也没有实例参考,请问下一步方向应该是怎么做呢
Asks the data source for a cell to insert in a particular location of the table view. (required)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
Parameters
tableView
A table-view object requesting the cell.
indexPath
An index path locating a row in tableView.
Return Value
An object inheriting from UITableViewCell that the table view can use for the specified row. An assertion is raised if you return nil.
Discussion
The returned UITableViewCell object is frequently one that the application reuses for performance reasons. You should fetch a previously created cell object that is marked for reuse by sending a dequeueReusableCellWithIdentifier: message to tableView. Various attributes of a table cell are set automatically based on whether the cell is a separator and on information the data source provides, such as for accessory views and editing controls.
Availability
Available in iOS 2.0 and later.
Declared In
UITableView.h
Asks the data source for a cell to insert in a particular location of the table view. (required)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
Parameters
tableView
A table-view object requesting the cell.
indexPath
An index path locating a row in tableView.
Return Value
An object inheriting from UITableViewCell that the table view can use for the specified row. An assertion is raised if you return nil.
Discussion
The returned UITableViewCell object is frequently one that the application reuses for performance reasons. You should fetch a previously created cell object that is marked for reuse by sending a dequeueReusableCellWithIdentifier: message to tableView. Various attributes of a table cell are set automatically based on whether the cell is a separator and on information the data source provides, such as for accessory views and editing controls.
Availability
Available in iOS 2.0 and later.
Declared In
UITableView.h