Chapter III: IOS Table Table View delegation protocol and Data Protocol

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.