On Apr 26, 2011, at 15:53, Adam R. Maxwell wrote:

> 
> On Apr 26, 2011, at 05:07 , Christiaan Hofman wrote:
> 
>> 
>> On Apr 23, 2011, at 6:20, Adam R. Maxwell wrote:
>> 
>>> 
>>> On Apr 22, 2011, at 20:49 , Adam M. Goldstein wrote:
>>> 
>>>> On Apr 22, 2011, at 6:00 PM, Maxwell, Adam R wrote:
>>>> 
>>>>> 
>>>>> On Apr 22, 2011, at 11:51, Maxwell, Adam R wrote:
>>>>> 
>>>>>> Hacking around that proved a bit more challenging than I expected, 
>>>>>> because of the interaction of the formatter, cell, field editor, and 
>>>>>> tableview...which all combine somehow.  Anyway, here's what I came up 
>>>>>> with:
>>>>> 
>>>>> ...unfortunately, it does very bad things to crossrefs.  Sigh.
>>>>> 
>>>> 
>>>> Is this new code in the nightlies? So I won't try out last night's...or 
>>>> maybe I will just to see what happens...
>>> 
>>> It's in the source tree I keep for my own hacking amusement, not in BD's 
>>> code.  Incidentally, I did fix the problem with crossrefs; using 
>>> -[NSTableColumn dataCellForRow:] was giving a copy of a cell with a 
>>> crossref formatter, since the proper formatter is set in -[BDSKEditor 
>>> tableView:willDisplayCell:..].  Using -[NSTableView preparedCell...] fixed 
>>> that, but I can see that my Cocoa is getting rusty; the insanity of 
>>> NSTableView/NSControl/NSCell/NSFormatter and the field editor was getting 
>>> to me!
>>> 
>>> -- adam
>>> 
>> 
>> Found another problem. The cell returns a mutable string, that may be (and 
>> often is) modified afterwards. So you must copy newValue before calling 
>> super.
>> 
>> I added it to the current source, with a few more sanity checks. 
> 
> Yeah, that was in my final version, too, as well as some checks for a nil 
> newValue in case formatting fails (which it never should, now).  There were a 
> surprising number of ugly little problems that made this difficult to fix.
> 

Of course an alternative solution without relying on private methods is to set 
the value in controlTextDidEndEditing: instead 
tableView:setObjectValue:forTableColumn:row:.

Christiaan


------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Bibdesk-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop

Reply via email to