Show how many groups
-(Nsinteger) Numberofsectionsintableview: (UITableView *) TableView
Show the head of each group
-(uiview*) TableView: (UITableView *) TableView viewforheaderinsection: (nsinteger) Section
Show the tail of each group
-(uiview*) TableView: (UITableView *) TableView viewforfooterinsection: (nsinteger) Section
Shows how high the trailing title of each group is
-(CGFloat) TableView: (UITableView *) TableView heightforfooterinsection: (Nsinteger) section{
return cgfloat_min;
}
Shows how high the header title is for each group
-(CGFloat) TableView: (UITableView *) TableView heightforheaderinsection: (nsinteger) Section
{
return cgfloat_min;
}
Show each group header title name
-(nsstring*) TableView: (UITableView *) TableView titleforheaderinsection: (nsinteger) Section
Show each group footer title name
-(nsstring*) TableView: (UITableView *) TableView titleforfooterinsection: (nsinteger) Section
Show each set of title indexes
-(Nsarray *) Sectionindextitlesfortableview: (UITableView *) TableView
Show how many rows each group has
-(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (nsinteger) Section
Show row height for each group
-(CGFloat) TableView: (UITableView *) TableView Heightforrowatindexpath: (Nsindexpath *) Indexpath
Show content
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath
Turn editing features on or off
if ([self.table isediting]) {
[Self.table Setediting:no Animated:yes];
}else{
[Self.table Setediting:yes Animated:yes];
}
Whether the corresponding row can be edited
-(BOOL) TableView: (UITableView *) TableView Caneditrowatindexpath: (Nsindexpath *) Indexpath
Set editing style
-(Uitableviewcelleditingstyle) TableView: (UITableView *) TableView Editingstyleforrowatindexpath: (Nsindexpath *) indexpath{
Uitableviewcelleditingstylenone,
Uitableviewcelleditingstyledelete, deleting
Uitableviewcelleditingstyleinsert add
}
Submit edits (left slide delete and add)
-(void) TableView: (UITableView *) TableView Commiteditingstyle: (uitableviewcelleditingstyle) Editingstyle Forrowatindexpath: (Nsindexpath *) Indexpath {
if (Editingstyle = = Uitableviewcelleditingstyledelete) {//delete
[Self.servicearry RemoveObjectAtIndex:indexPath.row];
[Self.tableview Deleterowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationbottom];//Delete Refresh
}
else if (Editingstyle = = Uitableviewcelleditingstyleinsert) {//Add
[Datas insertobject:@ "AB" AtIndex:indexPath.row];
[Self.table Insertrowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationbottom];//Add Refresh
}
}
Set whether you can move
-(BOOL) TableView: (UITableView *) TableView Canmoverowatindexpath: (Nsindexpath *) Indexpath
Submit a move result
-(void) TableView: (UITableView *) TableView Moverowatindexpath: (Nsindexpath *) Sourceindexpath Toindexpath: ( Nsindexpath *) destinationindexpath{
Save the data you want to move first
ID moveobj = [datas ObjectAtIndex:sourceIndexPath.row];
Delete the data to be moved from the array
[Datas RemoveObjectAtIndex:sourceIndexPath.row];
Insert the data you want to move to the target location
[Datas insertobject:moveobj AtIndex:destinationIndexPath.row];
}
Click events per row
-(void) TableView: (UITableView *) TableView Didselectrowatindexpath: (Nsindexpath *) Indexpath
IOS TableView Full explanation