ios - Why is awakeFromNib called twice from a Cell in a TableView? -
ios - Why is awakeFromNib called twice from a Cell in a TableView? -
i'm trying understand why awakefromnib beingness called twice in code. have tableview has special compressible cell appears 1 time @ end of table. first awakefromnib beingness called when tableview scrolled special cell @ end (which fine believe,as tableview reusing cells). however, whenever tap cell expand cell, awakefromnib beingness called again.
could explain me why awakefromnib beingness called twice? , how create called once?
thanks
edit** code people have requested
- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { if (indexpath.section >= (nsinteger)[self.trip.destinations count]) { guestcell *cell = (guestcell*)[tableview dequeuereusablecellwithidentifier:guestcellidentifier forindexpath:indexpath]; cell.selectionstyle = uitableviewcellselectionstylenone; [cell setupcellforguests:self.trip.guests]; cell.guestexpanded = no; nslog(@"returning cell"); homecoming cell; } // other sections homecoming [self preparecardcellforindexpath:indexpath forheightcalc:no]; } - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { if (indexpath.section >= (nsinteger)[self.trip.destinations count]) { [self.tableview reloadrowsatindexpaths:@[indexpath] withrowanimation:uitableviewrowanimationautomatic]; } }
if cell nib 1 in table, guess has animations. didn't check how tableview handles cells during animation, tableview header asks instance , performs animation (for illustration fade) - old instance faded out , new faded in. @ to the lowest degree that's think has highest probability, if handling cells correctly.
ios objective-c uitableview xib
Comments
Post a Comment