ios - How to get reference to current UITableViewCell -


at experiment need have reference first uitableviewcell in tableview. action need set image , other cell properties , keep state of cell if tableview scrolled. of properties can potentially nulled via scrolling (and are) because of reusing. set properties every time cell appears on screen, inside of `-cellforrowatindexpath' tried catch first cell using:

uitableviewcell *firstcell = (uitableviewcell *)[atableview cellforrowatindexpath:[nsindexpath indexpathforrow:0 insection:0]]; 

but looks way can catch every next first cell on next scrollable "screen". so, how can ref first uitableview cell?

if understand correctly, trying special if cell @ (0, 0) displayed, right? if that's case, can implement uitableviewdelegate's tableview:willdisplaycell:forrowatindexpath: method follows:

- (void)tableview:(uitableview *)tableview willdisplaycell:(uitableviewcell *)cell forrowatindexpath:(nsindexpath *)indexpath {   if (indexpath) {     // special   } } 

there corresponding tableview:didenddisplayingcell:forrowatindexpath: method if need undo things.

hope helps!


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -