Not sure about iOS but on OS X programmatically calling

    [NSSegmentedControl setSelectedSegment:]

does not trigger the target / action message.

You need to programmatically respond after setting the selected segment.

Richard Charles

On Oct 14, 2014, at 6:55 PM, Daniel Blakemore <dblakem...@pixio.com> wrote:

> I have a simple problem.  I am programmatically setting the selected
> segment of a segmented control.  Then the segmented control is changing
> which segment appears selected on screen.
> 
> You might be saying to yourself, "this seems correct".  You would also be
> correct.
> 
> What is incorrect is that while the control *appears* to have changed, my
> code knows nothing of this.
> 
> I have an action added for the control event UIControlEventValueChanged
> which is called as expected when you tap the control.
> 
> HOWEVER, when changing the control programmatically, no such event is
> generated.  This leaves my app in an inconsistent state.
> 
> For reference, see this example project
> https://github.com/danblakemore/SegmentedNope.
> 
> This worked in iOS 7.  It now does not.  What has changed?
> 
> --
> Daniel Blakemore
> Pixio Software
> _______________________________________________

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to