A. What you need to know 1. Basic Properties and methods
- Set DataSource, delegate for UITableView
- UITableView Multi-group data and single-group data presentation
- Common Properties of UITableViewCell
- UITableView Performance Optimization (cell recycling)
- Custom cell
The concept of 2.UITableView UITableView is that tabular data uitableview inherit from Uiscrollview, support vertical scrolling, and have two styles of good performance 3.UITableView
- Uitableviewstyleplain
- uitableviewstylegrouped
4. Display data
- UITableView needs a data source datasource to display the data
- UITableView How many rows of data and the display of each row are queried to the data source
- A uitableview without a data source is just an empty shell.
- Any OC object that complies with the Uitableviewdatasource protocol can be a UITableView data source
5.UITableView and data sources
1 // 2 -(Nsinteger) Numberofsectionsintableview: (UITableView *) TableView; // Default is 1 if not implemented 3 // 5 -(Nsinteger) TableView :(UITableView *) TableView numberofrowsinsection: (nsinteger) section; 6 // 8 -(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath;
Data source References:
1 // Data Source 2 ID<UITableViewDataSource> dataSource;
6.UITableView presentation Data process (1) Number of groups to get data
1 -(Nsinteger) Numberofsectionsintableview: (UITableView *) TableView;
(2) Number of rows per set of data
1 -(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (nsinteger) Section;
(3) Get the contents of each row of data
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath;
7. Parse the. plist file to store 8 of each dictionary in the data set in model packaging. M:modelv:viewc:control Introduction to 9.Cell using MVC mode 10. UITableViewCell Contentview 11.UITableViewCell Structure 12.Cell reuse principle in order to handle the load and display of large amounts of data, you do not have to create the same number of cells, Just load the data you currently need to display on the cell. Principle: Scrolling list, the UITableViewCell of the moving out window will be put into an object pool, when the data need to be displayed, the available UITableViewCell is removed from the object pool, and then the data display is loaded. 13. Custom cell reuse sometimes for a specific requirement, you need to customize the classes that inherit from UITableViewCell, and there may be multiple cells in one uitableview, causing confusion in the cell type in the object pool. Workaround: Use UITableViewCell's nssting *reuseidentifier property to initialize the cell to specify the Reuseidentifier, so that the object pool when the cell object is removed by this string to identify the first check, If not present, initializes a cell object with the passed-in string identity. 14.cell Reusing code
[iOS base Control-6.0] UITableView