Re: Astoundingly dumb bindings question - solved, simple as expected
Re: Astoundingly dumb bindings question - solved, simple as expected
- Subject: Re: Astoundingly dumb bindings question - solved, simple as expected
- From: "Andrew R. Kinnie" <email@hidden>
- Date: Sun, 1 Jul 2007 14:11:27 -0400
Thanks.
Not sure what the .{display} bit was in the second binding, but it
works if I ignored it.
On Jul 1, 2007, at 12:51 PM, Marcus S. Zarra wrote:
content -> NSArrayController.arrangedObjects
contentValues -> NSArrayController.arrangedObjects.{display}
selectedObject -> your accessor methods
Marcus S. Zarra
Zarra Studios LLC
Simply Elegant Software for OS X
www.zarrastudios.com
On Jun 30, 2007, at 5:58 PM, Andrew R. Kinnie wrote:
OK, I have looked at the docs, the archives, google, etc. I seem
to be having no luck doing something that should be crazy easy. I
want to have an NSPopUpButton, which is bound to an array of
NSNumbers. I have an action, which wants to grab the number from
the selection of the popup, and do something with it, displaying
the results of the calculation in a textfield.
I could do this programmatically, but I was thinking some of this
might be easier and quicker with bindings. So I created an array
controller to control the array I created in code, and used it to
populate the popup. No problem. I bound the content to the array
controller's arranged objects. Thing is, I can't seem to find an
appropriate binding or method to grab the object represented by
the popup's selection. I tried to bind the contentValues,
contentObjects, and lastly I tried selectedIndex bound to the
array controller's selectionIndex.
The best I get is a proxy object that is not the NSNumber, and
can't respond to intValue appropriately.
What should I be doing here? Thanks in advance.
_______________________________________________
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
_______________________________________________
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