[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSCell objectValue
From: |
Alexander Malmberg |
Subject: |
Re: NSCell objectValue |
Date: |
Tue, 27 Jul 2004 15:38:50 +0200 |
Andreas Hoeschler wrote:
> > I was mentioning this problem here about one year ago, and Adam told me
> > that this was the correct behaviour as documented by Apple:
> >
> > **
> > To be valid, the receiver must have a formatter capable of converting
> > the object to and from its textual representation.
> > **
> >
> > I don't like this either, because if you intend to use string values,
> > you need a dummy formatter that just passes the value. I couldn't
> > really believe Cocoa's behaviour was like this, but I don't have access
> > to a Cocoa machine, so I couldn't verify it.
>
> I have, and this is definitely wrong. If no formatter is set, the
> objectValue implementation of Cocoa simply uses stringValue to
> determine the return value. Returning nil makes only sense, if a
> formatter is set. I have corrected the GNUstep behaviour with a
> category, but I suggest to commit this change to the cvs.
This seems reasonable, but it does contradict the OPENSTEP and Cocoa
docs on this (and, for once, the docs are explicit). What does
-hasValidObjectValue return in this case?
/me adds to the list of things to look at when cleaning up NSCell...
- Alexander Malmberg