[SOLVED] Re: NSSegmentedControl subclass and bindings
[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