I am assuming here that your data is stored in an array.
In each
UITableViewCell
, where you have added theUISwitch
, set it'stag
to same as it'sindexPath.row
.mySwitch.tag = indexPath.row;
You can easily get the index of the object for which you had set the switch, using the the
tag
stored.[myArray objectAtIndex:mySwitch.tag];