Home > Mobile >  Get selected row details in submit button as alert
Get selected row details in submit button as alert

Time:02-21

I have a table-view that houses many cells. There is a button[submit] after the table view part with in view controller .Table view consists of number from 1 to 100 and a radio button for selection ,while click on any number it changes to selected state. My question is, how can I display the selected numbers as alert while click on submit button

CodePudding user response:

The key thing here is to forget all about the table view. Instead, concentrate on the model data from which the table view is constructed. Each time the user clicks on a number to toggle whether this one of the "selected" rows, you must read that back into the model data (which will obviously need some sort of property saying whether this is a "selected" row of the data). Now the button's job will be trivial: it just cycles thru the entire model data looking for the numbers whose "selected" is true.

  • Related