1.
A. Add a "self " to the place where the TableView attribute is set. TableView registerclass: [UITableViewCellclass ] Forcellreuseidentifier:@ "identifier"];
B.-(UITableViewCell *) TableView: (uitableview *) TableView Cellforrowatindexpath: (nsindexpath *) Indexpath {
UITableViewCell *cell = [TableView Dequeuereusablecellwithidentifier: identifierforindexpath: indexpath];// Because the related properties of reuse are set above, the reusable cells can be obtained directly by reusing strings, this method is only applicable to ios6.0 and above.
......
return cell;
}
2. -(UITableViewCell *) TableView: (uitableview *) TableView Cellforrowatindexpath: (nsindexpath *) Indexpath {
staticnsstring *identifier = @ "cell";
UITableViewCell *cell = [TableViewdequeuereusablecellwithidentifier : identifier ];
if (cell = = nil) {
cell = [[UITableViewCell alloc]initwithstyle:uitableviewcellstyledefault reuseidentifier:identifier];
}
//Configure the cell ...
return cell;
}
UITableView two ways to set up cell reuse