Instance Method

setSelected:forSegment:

Sets the selection state of the specified segment.

Declaration

- (void)setSelected:(BOOL)selected forSegment:(NSInteger)segment;

Parameters

flag

YES if you want to select the segment; otherwise, NO.

segment

The index of the segment whose selection state you want to set. This method raises an exception (NSRangeException) if the index is out of bounds.

Discussion

If the control allows only a single selection, this method deselects any other selected segments.

If the trackingMode property of the segment is set to NSSegmentSwitchTrackingMomentary, then attempting to set the selected state of the segment will have no effect.

See Also

Managing the Selected Segment

selectedSegment

The index of the selected segment of the control, or -1 if no segment is selected.

- selectSegmentWithTag:

Selects the segment with the specified tag.

- isSelectedForSegment:

Returns a Boolean value indicating whether the specified segment is selected.

selectedSegmentBezelColor

The color of the selected segment's bezel, in appearances that support it.

doubleValueForSelectedSegment

When the tracking mode for the control is set to use a momentary accelerator, returns a value for the selected segment.