OC Development _storyboard--uitableview

Source: Internet
Author: User

First, TableView

1. DataSource Data source

(1 The method of constructing each Tableviewcell:cellforrowatindexpath, the

Dequeuereusablecellwithidentifier will take the cell in the storyboard based on the identification ID, and it also uses the cell multiplexing in the cache

(2 also contains two other methods, numberofsectionsintableview default is to return 1 if you do not rewrite it, numberofrowsinsection is not the default value, so when implementing the data source this must be implemented

-(Nsinteger)numberofsectionsintableview:(UITableView *) sender;

-(Nsinteger) TableView: (UITableView *) sender numberofrowsinsection:(nsinteger) section;

2, delegate agreement, there are many ways, here just for example two

(1 For example, what line does the user order?) What's the operation?

-(void) TableView: (UITableView *) sender Didselectrowatindexpath:(Nsindexpath *) path

(2 Click on the icon for each cell as follows:

-(void) TableView: (UITableView *) sender Accessorybuttontappedforrowwithindexpath:(Nsindexpath *) Indexpath

3, Segue click on the cell to jump,

For example, jump to another segue, then the corresponding Prepareforsegue should know which cell is clicked, so the sender parameter has played this role

We can use nsindexpath *indexpath = [Self.tableview indexpathforcell:sender];

4. Spinner in loading

@property (strong) Uirefreshcontrol *refreshcontrol;

Turn on Load animation:-(void) beginrefreshing;

End Load Animation:-(void) endrefreshing;

Of course you need to start the configuration:

5. Reloaddata Reload Data

-(void)reloadrowsatindexpaths:(Nsarray *) indexpaths withrowanimation: (uitableviewrowanimation) Animationstyle;

Details of the TableView method can refer to the previous written article: http://www.cnblogs.com/daomul/p/4370128.html

OC Development _storyboard--uitableview

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.