#pragma mark-table View
//Set the number of sections
-(Nsinteger) Numberofsectionsintableview: (UITableView *) TableView {
Return1;
}
//Set the number of rows per section
-(Nsinteger) TableView: (UITableView *) TableView numberofrowsinsection: (nsinteger) Section {
Return[Dataarrylist Count];
}
//operate on each TableviewcellEach unit shown in the UITableView is aA UITableViewCell object whose initialization functionInitwithstyle:reuseidentifier:InTableView the rapid sliding of the process of sliding, frequentThe Alloc object is more time-consuming///, so it introducesThe reuse mechanism of cell
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath {
static nsstring* Cellidentifier = @ "cell";
uitableviewcell* cell = [TableView dequeuereusablecellwithidentifier:cellidentifier];
if (cell== nil) {
Cell= [[UITableViewCell alloc] Initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier];
}
cell.textlabel.text=[Dataarrylist ObjectAtIndex:indexPath.row];
return cell;
}
- (void) TableView: (UITableView *) TableView Commiteditingstyle: (uitableviewcelleditingstyle) Editingstyle Forrowatindexpath: (Nsindexpath *) Indexpath {
if (Editingstyle = =Uitableviewcelleditingstyledelete) {
[Self.dataarrylist RemoveObjectAtIndex:indexPath.row];
[TableView Deleterowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationfade];
}else if (Editingstyle = = Uitableviewcelleditingstyleinsert) {
[Self.dataarrylist InsertObject:@ "456" AtIndex:indexPath.row];
[TableView Insertrowsatindexpaths:[nsarray Arraywithobject:indexpath] Withrowanimation: Uitableviewrowanimationright];
// Create A new instance of the appropriate class, insert it into the array, and add a new row to the table view.
}
}
//Set UITableView Line Indent
-(Nsinteger) TableView: (uitableview*) TableView Indentationlevelforrowatindexpath: (Nsindexpath *) indexpath{
Nsuinteger row =[Indexpath Row];
ReturnRow
}
//Set the height of the cell row interval
-(cgfloat) TableView: (UITableView *) TableView Heightforrowatindexpath: (Nsindexpath *) indexpath{
Return60;
}
//Set the response event for the selected cell
-(void) TableView: (uitableview*) TableView Didselectrowatindexpath: (Nsindexpath *) indexpath{
}
//Set the action performed on the selected row
-(nsindexpath*) TableView: (UITableView *) TableView Willselectrowatindexpath: (Nsindexpath *) Indexpath
{
nsuinteger row = [Indexpath row];
return Indexpath;
}
// Set the Del button for the scrub cell to be processed in the deleted data
- (BOOL) TableView: (UITableView *) TableView Caneditrowatindexpath: (Nsindexpath *) Indexpath {
}
// edit state when deleting
- (void {
}
IOS UITableView Proxy methods