Re: NSTableView and multiple NSArrayControllers
Re: NSTableView and multiple NSArrayControllers
- Subject: Re: NSTableView and multiple NSArrayControllers
- From: Scott Anguish <email@hidden>
- Date: Mon, 26 Apr 2004 13:57:36 -0400
On Apr 26, 2004, at 9:34 AM, Gabriele de Simone wrote:
On Apr 26, 2004, at 1:22 AM, Scott Anguish wrote:
On Apr 26, 2004, at 12:38 AM, Gabriele de Simone wrote:
I just noticed that IB shows three bindings for an NSTableView
(content, selectionIndexes, sortDescriptors) whereas calling NSLog
on [NSTableView exposedBindings] only displays two (rowHeight,
value). Why the discrepancy? Where are those bindings really
exposed?
[...]
when you create a binding for a NSTableColumn, the content binding
is created automatically for you for that particular tableview...
but, it doesn't set the content binding through the bind: API that
you use. You need to explicitly set the
Also.. I don't think you can have multiple arraycontrollers wired to
a single tableview.
I am only using a second NSArrayController to populate the
NSPopUpMenuCell's in a table column, as shown in one of the ubiquitous
Cocoa examples. The problem is that the menu is getting populated with
things like <SomeObject 0xSOMEADDR> instead of the original objects,
even though the array returned to the table is valid both in content
and in number of elements. My suspicion was that binding the
NSTableView sortDescriptors manually to the NSArrayController was
screwing things up. Is sortDescriptors also automatically bound to the
array controller?
oh, that's fine
I think the issue you're seeing is that the string is either being
derived from -description (which I've discussed elsewhere) or you need
to set the contentValue binding as well.
I will abuse yours (and everyone else's) help for one more question:
when using KVC to expose a variable that we want to be read-only, is
it sufficient to simply not provide the setter method? Will the
runtime infer from the absence of a setter method that the variable is
immutable?
nope. it'll use KVC to set it.
you could implement the setter and then have that be a no-op. I'd
need to know the context in order to make a more full recommendation
though.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.