ios - Create different instance of buttons in view controller for tableview -


i have created uitableview has cells uiviewcontroller opens when click on one. have vote button on uiviewcontroller want toggle between "yes" , "no" each time user clicks on it. when click table cell, vote button, uitableview , click on same cell again defaults "yes". how keep reverting "yes" having each cell open different instance of button being either "yes" or "no"?

when push view controller, or in prepareforsegue, set initial value vote value in selected cell. assuming understood question want voting controller reflect current value in cell.

in viewwillappear of voting controller, set voting button/view value set on push.

this should mean controller comes same value cell had last time.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

ios - Possible to get UIButton sizeThatFits to work? -