UITableViewDataSource TableView data source proposal, tableview

Source: Internet
Author: User

UITableViewDataSource TableView data source proposal, tableview

UITableViewDataSource TableView data source proposal
Mainly, data editing (deletion, insertion), indexing, mobile sorting operations, whether to allow editing (deletion, insertion) and mobile sorting, set the number of lines displayed, the number of groups, cell display
-(NSInteger) tableView :( UITableView *) tableView numberOfRowsInSection :( NSInteger) section;
Returns the number of rows in a group.
-(UITableViewCell *) tableView :( UITableView *) tableView cellForRowAtIndexPath :( NSIndexPath *) indexPath;
The cell then asks the data source and adds the cursor to tableView.
-(NSInteger) numberOfSectionsInTableView :( UITableView *) tableView;
How many groups are returned and how many parts are returned (the default value is 1. This method can not be implemented)
-(NSString *) tableView :( UITableView *) titleForHeaderInSection :( NSInteger) section;
(Fixed body fixed font style. If you want a different style, use custom view (UILabel ))
-(BOOL) tableView :( UITableView *) tableView canMoveRowAtIndexPath :( NSIndexPath *) indexPath
If the row can be moved, return NO will not be able to execute the sort operation (for example, the move button will not appear)
-(BOOL) tableView :( UITableView *) tableView canEditRowAtIndexPath :( NSIndexPath *) indexPath;

Control whether to edit. If return NO cannot be edited (for example, deletion will not appear)
-(NSString *) tableView :( UITableView *) tableView titleForHeaderInSection :( NSInteger) section;
The header and title data source of the specified part of the table view.
-(NSString *) tableVIew :( UITableView *) tableVIew titleForFooterInSection :( NSInteger) section;
The data source of the footer title of the specified part of the table view.
-(NSArray *) sectionIndexTitlesForTableView :( UITableView *) tableView;
Returns the title of each group. The title is displayed in the index view.
-(Integer) tableView :( UITableView *) tableView sectionForSectionIndexTitle :( NSString *) title atIndex :( NSInteger) index;
Return the index location of the group. (In this method, you can receive the index title. If the index is written as a fixed value, the index will not beat)
-(Void) tableView :( UITableView *) tableView commitEditingStyle :( UITableViewCellEditingStyle) editingStyle forRowAtIndexPath :( NSIndexPath *) indexPath;
Delete and insert a specific row (editingStyle, edit type, which can be used to identify whether to delete or insert
)
-(Void) tableView :( UITableView *) tableView moveRowAtIndexPath :( NSIndexPath *) sourceIndexPath toIndexPath :( NSIndexPath *) destinationIndexPath;
The data source is placed in a specific position in the table view to another position. (This method is used for sorting operations)



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.