Which UISwitch was changed when its selector is called?

I have created several UISwitches programmatically.
I have a selector assigned to call a method when the switch is changed.
Right now the selector calls the same method regardless of which switch is changed.

When the method is called is there a way to know where I came from? In other words which switch was pressed?

Thanks - Ed

You can use the tag property. Assign each UISwitch a unique tag number and then use that tag in your selector to determine which switch was changed.

Thank you, that was exactly what I needed.

Ed