Deleselect uisegmentedcontrol selection after clicking on a save button

Ayrad picture Ayrad · Jan 8, 2012 · Viewed 7.1k times · Source

I'm using a 3 button UISegmented control for a choice selection. I also have a save button that retrieves the chosen control.

When the save button is clicked I want to have to UISegmentedcontrol cleared (ie the previous selected button unselected). I'm not looking for the setMomentary as I want the selection to stick but also be able to unselect it later.

Answer

Gabriel Tortelli picture Gabriel Tortelli · Sep 15, 2012
[myUISegmentedControl setSelectedSegmentIndex:UISegmentedControlNoSegment];