objective c - Array of UITableViewCells to be reused in ios -


in cellforrowatindexpath: delegate n number of cells (corresponding indexpath.row) created , added array cellsarray how reuse each cell in array, when cellsarray count 7? (want reuse cells batch of 7)

finamecell *cell = nil; if ([finamecellcells count] > indexpath.row) {     cell = [finamecellcells objectatindex:indexpath.row]; } else {     cell = [[[nsbundle mainbundle] loadnibnamed:@"finamecell" owner:self options:nil] objectatindex:0];     [cellsarray addobject:cell]; } 

you're not supposed manually load cells nibs these days. way call uitableview's dequeuereusablecellwithreuseidentifier:forindexpath cell being either defined prototype cell in ib or associating cell via registernib:forcellreuseidentifier beforehand.

after that, don't worry cell reuse, it's going automatic.


Comments