• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSSegmentedControl Behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSegmentedControl Behavior


  • Subject: NSSegmentedControl Behavior
  • From: Jason Barker <email@hidden>
  • Date: Mon, 17 Apr 2006 14:00:48 -0600

I have a segmented control in a window and when I click on one of the segments, I want to get the label for the segment and then change it back to a non-selected state. Here's what I think my code should be to accomplish this but it's not working the way I thought it would. The segment stays selected. What do I need to change to make it behave the way I want it to?

- (IBAction)controlClicked:(id)sender
{
  int currIdx = [segmentedControl selectedSegment];
  NSString *segmentLabel = [segmentedControl labelForSegment:currIdx];
  NSLog(@"Segment Label: %@", segmentLabel);
  [segmentedControl setSelected:NO forSegment:currIdx];

  ... Additional processing ...
}


Thanks for your help, Jason _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSSegmentedControl Behavior
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: C# to Objective-C translator?
  • Next by Date: Re: C# to Objective-C translator?
  • Previous by thread: Re: C# to Objective-C translator?
  • Next by thread: Re: NSSegmentedControl Behavior
  • Index(es):
    • Date
    • Thread