NSArrayController, NSTableView, Bindings, and Checkboxes problem.
NSArrayController, NSTableView, Bindings, and Checkboxes problem.
- Subject: NSArrayController, NSTableView, Bindings, and Checkboxes problem.
- From: Martin Redington <email@hidden>
- Date: Sat, 25 Jun 2005 18:23:34 +0100
I am having trouble getting checkboxes to work correctly in an
NSTableView, which is populated using bindings to an NSArrayController.
My main class exposes an NSMutableArray, which contains instances of
a class with a -(BOOL) enabled; method (and a corresponding setter),
and which is bound to an NSArrayController.
The first table column is bound to the enabled property of
NSArrayController.arrangedObjects
My window controller sets the cell of the relevant column to be an
NSButtonCell, during awakeFromNib.
Everything works fine for all of the other columns, and generally
bindings seem to be working as expected.
The checkbox column displays a checkbox appropriately, and this is
checked or unchecked, depending on whether the enabled property is
set to YES or NO during the object's init method.
*However*, clicking on the checkbox does not seem to change the
checkbox appearance, or the underlying value :-(
By default, double clicking on the checkbox seems to bring up a
normal cell editor, where text can be entered.
If the "editable" attribute of the checkbox is set to off in IB, then
this stops. The checkbox does seem to receive mouse clicks, as the
colour changes subtly when the mouse is depressed, but the setEnabled
method of the underlying array object doesn't get called (and the
checkbox remains in its original state when the mouse is released).
As mentioned above, all the other bindings stuff seems to be working
fine, and checkboxes outside tables, that I have bound to BOOLean
properties work correctly too.
I am using XCode 2.1, and the latest (2.5.1) version of xcode as well.
Any hints or pointers gratefully received ...
cheers,
m.
which contains instances of a class with a -(BOOL) enabled; method
(and a corresponding setter).
An NSArrayController is bound to the mutable
_______________________________________________
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