views:

284

answers:

2

How can I get the text value of a segment in a UISegmentedControl?

+3  A: 
[segment titleForSegmentAtIndex:segment.selectedSegmentIndex];
Kevin Sylvestre
Thanks! It works perfectly
Matt S.
+2  A: 
[segmentedControl titleForSegmentAtIndex:int];

For the current selected index

[segmentedControl titleForSegmentAtIndex:[segmentedControl selectedSegmentIndex]];
Brandon Bodnár
Thanks! I decided to mark kevin because he has less rep
Matt S.
@Matt S. No problem. I think he beat me by one second anyways. :)
Brandon Bodnár