• 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
Re: NSSegmentedControl and Bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSegmentedControl and Bindings


  • Subject: Re: NSSegmentedControl and Bindings
  • From: Timothy Larkin <email@hidden>
  • Date: Wed, 31 Aug 2005 06:35:42 -0400


On Aug 30, 2005, at 6:10 AM, <email@hidden> <kyoso34- email@hidden> wrote:


I'm trying to bind either of the two segments in my
NSSegmentedControl object to a particular property in
NSArrayController each, namely canSelectNext:, to set
its enabled binding.

As I understand the documentation, the individual segments do not work as independent controls, and what you want to do cannot be done in IB alone. The problem must be addressed through the NSSegmentedControl. I subclassed NSArrayController, assigned the NSSegmentedControl target to a method of the array controller subclass, and within that method distinguished separate actions for the individual cells. Thus the array controller subclass has a method click:,


-(IBAction)click:(NSSegmentedControl*)sender
{
    int cell = [sender selectedSegment];
    if (cell == 0) {
        [self add:sender];
    } else {
        [self remove:sender];
    }
}

Tim Larkin
Abstract Tools
_______________________________________________
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


References: 
 >NSSegmentedControl and Bindings (From: <email@hidden>)

  • Prev by Date: Re: Object Identity Tests in Core Data
  • Next by Date: Re: Unarchive Data from URL (was Can't Convert Image...)
  • Previous by thread: NSSegmentedControl and Bindings
  • Next by thread: Slightly Off-Topic: Help on PCI Drivers wanted
  • Index(es):
    • Date
    • Thread