tags:

views:

532

answers:

1

iPhone app:

I have an UITableView with about 30 custom cells each containing an UISegmentedControl. I have wired up the UIControlEventValueChanged event to get hold of selectedIndex.

I would also like to get hold of UISegmentedControl's identity to identify it among the 30 UISegmentedControls. So, how can I get hold of the identity for the current UISegmentedControl that triggered the event? I have not found an "id" or "name" property for UISegmentedControl...

Any pointers appreciated.

Timo

+1  A: 

Try using the tag property of the UISegmentedControl. You can set this to an integer (in your case, probably 1-30), and access it from the UIControlEventValueChanged action.

Ben Gottlieb
Hey! Thanks, it worked. I come from .NET background and I thought if there was a Tag-property at Apple-world too....I didn't find it from the Documentation, so I'd better practice my documentation reading skills. =)