Re: How does the NSArrayController selection get set by a view?
Re: How does the NSArrayController selection get set by a view?
- Subject: Re: How does the NSArrayController selection get set by a view?
- From: Kaspar Fischer <email@hidden>
- Date: Mon, 12 Dec 2005 17:58:57 +0100
On 09.12.2005, at 21:14, Chad Woolf wrote:
I am implementing a custom view, and I want to allow my view's
selection to be reflected back to the NSArrayController, like when
selecting rows on an NSTableView. I can do this by binding the
controller's "selectionIndex" to my view's "selectionIndex" (that
is what I called my binding which changes when the user selects
something different, like the selectionIndexes on an NSTableView).
That's how I have done it, too.
This works fine, but I don't have to explicitly set this binding in
the Interface Builder so I think I'm missing something important on
how the controllers are supposed to work, or the IB is making this
binding implicitly and not making that obvious.
IB does not create this binding implicitly. When you load
the custom view, you should bind its "selectionIndex" to the
controller.
Have a look at mmalc's "Graphics Bindings" example at
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
The custom view is called GraphicsView there (see
GraphicsView.m) and the manual binding is done in
MyDocument.m, line 38.
Regards,
Kaspar
_______________________________________________
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