discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSTextField setStringValue nil value


From: Fred Kiefer
Subject: Re: NSTextField setStringValue nil value
Date: Mon, 23 Apr 2012 22:56:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120328 Thunderbird/11.0.1

Have you done more tests on this? Who is raising the exception, the text field, the control or the cell? Or will I have to do these tests myself?

In [NSCell-setStringValue:] we have this code:

  if (aString == nil)
    {
      NSDebugMLLog (@"MacOSXCompatibility",
                    @"Attempt to use nil as string value");
    }

Did this get triggered in your case? And if not, why not? If you are interested in Mac compatibility you could run your code with the option --GNU-Debug=MacOSXCompatibility

Hope this helps,
Fred

On 20.04.2012 20:09, Riccardo Mottola wrote:
while porting an application from GNUstep to Cocoa, I noticed that while
Cocoa rises an exception if you send nil with setStringValue to a
textfield, GNUstep silently accepts it.

I think we should match Apple's behaviour which appears to be this since
a long time [1] (note the commentof setStringValue vs. setObjectValue)

I couldn't find an explicit reference of this in NSCOntrol's
documentation though.

Riccardo



[1]
http://www.cocoabuilder.com/archive/cocoa/343-clearing-nstextfield.html#338




reply via email to

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