discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCell objectValue


From: dlatt
Subject: Re: NSCell objectValue
Date: Tue, 27 Jul 2004 08:18:01 +0200

Andreas Hoeschler <ahoesch@smartsoft.de> schrieb am 26.07.2004,
13:21:52:
> I just relaized that the following returns nil which is wrong in my 
> opinion.
> 
>       NSCell cell; // assume thi sexists
>       [cell setStringValue:@"Hello"];
>       return [cell objectValue];
> 
> I looked into the code and it looks that this behaviour is intended, 
> but IMHO this is wrong, at least it is incompatible with Cocoa. Should 
> we change NSCells objectValue to return the NSString if no formatter 
> was set?
> 

Hi Andreas,

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.

Greetings,
Dirk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]