I realize that part of the code is likely wrong in setObjectValue:. I need to correct that (or Fred can) when I have access to the code (in a few hours). I had thought that I put an else there to use description as a fallback if stringValue or attributedStringValue were not available.
As I told Fred, I will write a test case to illustrate this behavior on Mac OS X.
Gregory Casamento -- Principal Consultant - OLC, Inc
# GNUstep Chief Maintainer
From: David Chisnall
<address@hidden>
To: Gregory John Casamento <address@hidden>
Cc: Fred Kiefer <address@hidden>; GNUstep Developer <address@hidden>
Sent: Monday, February 16, 2009 11:58:19 AM
Subject: Re: [Gnustep-cvs] r27874 - in /libs/gui/trunk: ChangeLog Source/NSCell.m
I just checked the Apple documentation. It says:
For Mac OS X v10.3 and later: If you use a class that responds to the selectorattributedStringValue for the object value of a cell, the cell uses that method to fetch the string to draw rather than the stringValue method.
This is not what the code Fred posted does. It calls -attributedStringValue, but then sets the contents to the return from -description.
Checking the documentation for -setObjectValue: there is nothing to indicate that -description is ever called; it requires an NSFormatter to be provided to convert from the object value to the display string, although this may be undocumented behavior.
David
On 16 Feb 2009, at 16:47, Gregory John Casamento wrote:
> "If Apple really allows non-String parameters to setStringValue: this is
> rather a bug then a feature. If you insist to add this to GNUstep, it is
>
fine for me, but at least we should not break working GNUstep code for this."
>
> Since it is documented on their site I would not classify this as a bug. It is a bug on our side if we don't have it, in my opinion.
>
> GC
> Gregory Casamento -- Principal Consultant - OLC, Inc
> # GNUstep Chief Maintainer