Hi,
On 01/18/2012 11:20 AM, Dr. H. Nikolaus Schaller wrote:
Here:
http://www.gnustep.org/resources/OpenStepSpec/ApplicationKit/Classes/NSCell.html
• - (void)setStringValue:(NSString *)aString Sets the NSCell's value
to a copy of aString.
So you should find out why it does not set the value to a copy.
Ok, maybe my patch is wrong, I can take it out. The problem could be
indeed NSCell.. I see it does:
line 335
id newContents;
ASSIGN (_object_value, object);
if (_formatter == nil)
{
if (object == nil || [object isKindOfClass: [NSString class]] == YES)
{
newContents = object;
_cell.contents_is_attributed_string = NO;
_cell.has_valid_object_value = YES;
}
<....>
ASSIGN (_contents, newContents);
I see no "copy" method here, perhaps the fix is as simple as
newContents = [NSString stringWithString: (NSString*)object)];
stringWithString should be fine if our own gnustep doc is correct:
+ (id) *stringWithString:* (NSString
<http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSString.html#class$NSString>*)aString;
*Availability:* MacOS-X 10.0.0
Create a copy of aString.