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)