ios - UIButton not working in UITableview -


enter image description herehave uitableviewcell --> inside have 4 different uiview , 3 of views has uibuttons. want make uibutton clickable. first time buttons clickable when go next screen , come back, buttons don't work. please let me know how implement this? thanks!

phmytripview *tripsview=[[phmytripview alloc] initwithframe:cgrectmake(10, 5, self.frame.size.width-20, cell.frame.size.height)];

                         tripsview.onbaggageclick = ^{                              [weakself handlebaggagepurchasetapped];                          };                           if ([data count]>0) {                              [tripsview filltripdata:[data firstobject]];                              [tripsview showancillaries:self.predictivemanager.upcomingcdairbookinginfo];                          }                          [cell bringsubviewtofront:tripsview.bagsbutton];                          [cell.viewplaceholder addsubview:tripsview]; 

this happens because cells reusable , if go screen button may kinda mess round different cell in ui or functionally.

the way solve add tag. can define cell.tag = indexpath.row * 10 or so.

then when draw button, check condition, if cell.tag == ?, add button.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -