If the cell is not used for recycling. A cell is recreated each time the data is displayed, and if the displayed data is re-displayed again, a cell is recreated, which can result in a waste of memory.
Solution: is to let the displayed cell into the cel pool, each time you need to use the time to take out, change the content display, swipe outside the screen to put this cell into the cell pool again waiting for the next display data. So the screen shows several cells, this is the cell altogether need to create this multiple +1.
For example: The screen can display a full 11 cells, then you need to create a 12 cell.
If you swipe on the screen, and then show off Lori, the cell is useless, and is stored in the cell pool, then show the shadow stream of the hero below the cell will not be created, but to take out the last cell pool cell changed the data displayed, so loop down.
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath { static NSString *id = @ "Hero"; Extracting data from the pool uitableviewcell *cell = [TableView dequeuereusablecellwithidentifier:id]; if (cell = = nil) { //create cell, it is useless to put in the ID pool cell = [[UITableViewCell alloc] Initwithstyle: Uitableviewcellstylesubtitle reuseidentifier:id]; } Hero *hero = Self.heros[indexpath.row]; Cell.textLabel.text = Hero.name; Cell.detailTextLabel.text = Hero.intro; Cell.imageView.image = [UIImage ImageNamed:hero.icon]; return cell;}
"iOS development" about UITableView's cell loop usage