Cocoa Touch - Segmented Controls
How can I get whats been selected in a segmented 开发者_运维百科control?
Use selectedSegmentIndex
.
EDIT:
To retrieve the title of the segment, pass this NSInteger
into titleForSegmentAtIndex:
. Please note that if selectedSegmentIndex
does not return a positive value, using it for titleForSegmentAtIndex
will cause an error.
精彩评论