Re: Non-editable TableView and the Evil NSEditorBinder
Re: Non-editable TableView and the Evil NSEditorBinder
- Subject: Re: Non-editable TableView and the Evil NSEditorBinder
- From: Keary Suska <email@hidden>
- Date: Sat, 02 Aug 2008 14:25:20 -0600
- Thread-topic: Non-editable TableView and the Evil NSEditorBinder
8/2/08 7:30 AM, also sprach email@hidden:
> I have a TableView with DataSource who's columns are set (in IB) to
> Editable.
> When the thing gets loaded from its nib I do for its columns:
> NSTextFieldCell *aCell = [ aTableColumn dataCell ];
> [ aCell setEditable: NO ];
> [ aCell setSelectable: YES ];
>
> So I have a table with selectable, but not editable cells. Perfect.
If the default state of your cells is non-editable, everything above is a
pointless exercise. Start with your default state, then change when you need
to.
Anyway...
> Then I tried to use an NSArrayController instead of the DataSource.
> But now some evil NSEditorBinder comes and makes my cells editable
> again. Most annoying!
Well, it looks like you have bound the editable binding, and so it will do
exactly as your bound model indicates.
> 2008-08-02 20:02:07.001 GetMetaData[1266] -[GmdCell setEditable:] 1
> self: 0x3ef4f0 -- bad
> #1 0x93a03304 in -[NSEditorBinder
> _adjustStatesOfObject:mode:state:triggerRedisplay:] ()
> #2 0x93a05740 in -[NSValueBinder
> updateTableColumnDataCell:forDisplayAtIndex:] ()
> #3 0x93a05ed8 in -[NSTextValueBinder
> updateTableColumnDataCell:forDisplayAtIndex:] ()
> #4 0x93a05664 in -[_NSBindingAdaptor
> tableColumn:willDisplayCell:row:] ()
> #5 0x93862ffc in -[NSTableView
> _sendDelegateWillDisplayCell:forColumn:row:] ()
> #6 0x93862a3c in -[NSTableView _drawContentsAtRow:column:clipRect:] ()
> #7 0x93862430 in -[NSTableView drawRow:clipRect:] ()
> #8 0x938621ec in -[NSTableView drawRowIndexes:clipRect:] ()
> #9 0x93861874 in -[NSTableView drawRect:] ()
>
> Is there any way to stop this nefarious interference with my cells?
Are you sure it isn't your own code that isn't behaving the way you want?
> Or should I just ignore these newfangled bindings stuff?
Although bindings aren't always the best answer to every MVC question, they
save a lot of code and effort. And if you ever want to get into Core Data,
you will find bindings invaluable. I would recommend slogging ahead as best
you can...
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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