It all depends on your table, code, etc. etc., but if you are just looking for a string, one option would be to set the UISwitch tag UISwitch to indexPath.row (or some kind of value where you can calculate this). Sort of:
[switchObj setTag:indexPath.row]
Then you will have the row id in your method:
- (void)aggiungiTag:(id)sender { NSLog(@"the tag value is: %d, row is %d", [sender isOn], [sender tag]); return; }
It all depends on the end goal and what the rest of the application does, but it's cheap and easy.
source share