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

[SOLVED] Re: NSSegmentedControl subclass and bindings


  • Subject: [SOLVED] Re: NSSegmentedControl subclass and bindings
  • From: Dorian Johnson <email@hidden>
  • Date: Fri, 29 Jun 2007 18:02:22 -0500

Thanks for all the help, that resolves it!

For anyone having this problem, the easiest way to do it is (warning: this ignores options and value transformers which was alright for me)

unsigned newSelectedIndex;
[self setSelectedSegment:newSelectedIndex];

NSDictionary *bindingInfo = [self infoForBinding:@"selectedIndex"];
[[bindingInfo objectForKey:NSObservedObjectKey] setValue:[NSNumber numberWithUnsignedInt:newSelectedIndex] forKeyPath:[bindingInfo objectForKey:NSObservedKeyPathKey]];


- Dorian

On Jun 29, 2007, at 5:38 PM, mmalc Crawford wrote:

On Mac OS X 10.4, you can get information about a given binding using -infoForBinding:. You can then send a setValue:forKey: message to the observed object when the value changes. See <http:// developer.apple.com/samplecode/BindingsJoystick/>.

_______________________________________________

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


References: 
 >NSSegmentedControl subclass and bindings (From: Dorian Johnson <email@hidden>)
 >Re: NSSegmentedControl subclass and bindings (From: mmalc Crawford <email@hidden>)
 >Re: NSSegmentedControl subclass and bindings (From: Dorian Johnson <email@hidden>)
 >Re: NSSegmentedControl subclass and bindings (From: mmalc Crawford <email@hidden>)
 >Re: NSSegmentedControl subclass and bindings (From: Dorian Johnson <email@hidden>)
 >Re: NSSegmentedControl subclass and bindings (From: mmalc Crawford <email@hidden>)

  • Prev by Date: Re: NSSegmentedControl subclass and bindings
  • Next by Date: Re: NSSegmentedControl subclass and bindings
  • Previous by thread: Re: NSSegmentedControl subclass and bindings
  • Next by thread: Re: NSSegmentedControl subclass and bindings
  • Index(es):
    • Date
    • Thread