samvermette/SVSegmentedControl — Issue #16: Changing 'selectedIndex' property after adding instance to view has no effect.
Author: JEXcome
Created: 2012-02-17 07:17:58+00:00
State: open

Hi all.
I was implementing the "set defaults" routine for some instances of SVSegmentedControl, but I have trouble with setting selectedIndex' property.

The code below will be enough to perform this situation :

SVSC = [[SVSegmentedControl alloc] initWithSectionTitles:[NSArray arrayWithObjects:@"zero", @"one", nil]];
forControlEvents:UIControlEventValueChanged];

// some customization ...

SVSC .selectedIndex = 1;

[self.workArea addSubview:SVSC ];

SVSC .selectedIndex = 0;

In result I have selected the item #0, not #1.

Is there any suggestion how to this manipulation take effect?
Or maybe i'm do something wrong?