• 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 send action only from the selected segment
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSegmentedControl send action only from the selected segment


  • Subject: NSSegmentedControl send action only from the selected segment
  • From: Michele Barboni <email@hidden>
  • Date: Thu, 19 Mar 2009 10:11:01 +0100

Hi,

I've a NSSegmentedControl, 7 segments (labeled with weekdays), which has selectedIndex bound through a value transformer (NO reverse transformation) to NSDates.
Now, one of my awakeFromNib do this:


[sedutaDays setTarget:self];
[sedutaDays setAction:@selector(setWeekDay:)];
[sedutaDays setContinuous:YES];

setWeekDay: essentially change the day of the NSDate which NSSegmentedControl is bound to, by accessing the NSArrayController, selectedObjects:, objectAtIndex:0, and so on..

The problem is that my setWeekDay: action is sent only if I click the selected segment (set by binding), clicking on any of other 6 segments results in an attempt to reverse transform the value, which obviously fail with "[NSCFNumber timeIntervalSinceReferenceDate]: unrecognized selector sent to instance 0x1019a40" since my value transformer doesn't reverse..

Any idea why it seems that only selected segments has setAction: ?

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSSegmentedControl send action only from the selected segment
      • From: Michele Barboni <email@hidden>
  • Prev by Date: How do you store an NSArray as an attribute in a Core Data entity
  • Next by Date: Re: How do you store an NSArray as an attribute in a Core Data entity
  • Previous by thread: Re: How do you store an NSArray as an attribute in a Core Data entity
  • Next by thread: Re: NSSegmentedControl send action only from the selected segment
  • Index(es):
    • Date
    • Thread