The table view has two important protocols
Uitableviewdatasource: Data Source protocol
Method |
return type |
Description |
Must implement |
Tableview:cellforrowatindexpath: |
uitableviewcell* |
Provides data for a table view cell, which is a method that must be implemented |
Is |
Tableview:numberofrowsinsection: |
Nsinteger |
Returns the number of rows in a section |
Is |
Tableview:titleforheaderinsection: |
NSString |
Returns the heading of a section header |
Whether |
Tableview:titleforfooterinsection: |
NSString |
Returns the header of a section pin |
Whether |
Numberofsectionsintableview: |
Nsinteger |
Returns the number of sections |
Whether |
Sectionindextitlesfortableview: |
nsarray* |
Provide table View Section index title |
Whether |
TableView:commitEditingStyle:forRowAtIndexPath: |
void |
Provide data for deletion or modification |
Whether |
uitableviewdelegate: A delegate agreement that is used primarily to set the header of a section header and a section foot in a table view and to respond to some action events
Method |
return type |
Description |
Do you need to implement |
Tableview:viewforheaderinsection: |
UIView * |
Prepare a custom view for the section header, which you can use after IOS 6 Uitableviewheaderfooterview |
Whether |
Tableview:viewforfooterinsection: |
UIView * |
Prepare custom views for your feet, and you can use Uitableviewheaderfooterview after IOS 6 |
Whether |
TableView:didEndDisplayingHeaderView:forSection: |
void |
This method is triggered when the node header disappears from the screen (the method after IOS 6) |
Whether |
TableView:didEndDisplayingFooterView:forSection: |
void |
Triggered when the leg disappears from the screen (the method after IOS 6) |
Whether |
TableView:didEndDisplayingCell:forRowAtIndexPath: |
void |
Triggered when a cell disappears from the screen (the method after IOS 6) |
Whether |
Tableview:didselectrowatindexpath: |
void |
Method called when responding to the selection of a table view cell |
Whether |
Chapter III: IOS Table Table View delegation protocol and Data Protocol