IOS-tableview learning v4.0

Source: Internet
Author: User

View uitableview. h file

The structure seems very simple.

There are two protocols.Uitableviewdelegate,Uitableviewdatasource, A classNsindexpath

ForUitableviewdelegateProtocol, which is written in Apple's file:

This represents the display and behaviour of the cells.

My understanding is various operations on cells. In fact, it also contains the form of table display and so on.

ForUitableviedatasourceProtocol, which is written in Apple's file:

This Protocol represents the data model object. As such, it supplies no information about appearance (including the cells)

In my understanding, this protocol is used to process various data-related operations, excluding any interface operations.

This Protocol has two methods that must be implemented:

Tableview: numberofrowsinsectionAndTableview: cellforrowatindexpath:Two methods are required for the data source of each table view. The former tells the table view how many rows of cells exist, and the latter tells the table view what the content of each cell is.ProgramBy implementing these two methods, you can provide the basic information required by a table view and call the table view.

 

Related Article

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.