Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: NSTextField setStringValue nil value

81 views
Skip to first unread message

Fred Kiefer

unread,
Apr 23, 2012, 4:56:44 PM4/23/12
to discuss...@gnu.org
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


Riccardo Mottola

unread,
Apr 23, 2012, 5:17:02 PM4/23/12
to Fred Kiefer, discuss...@gnu.org
Hi Fred,

Fred Kiefer wrote:
> 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
>
I was running without that flag... so is it expected that GNUstep
behaves slightly different? IN case, I'm fine, else I will prepare a
testcase as you request. It won't be difficult. IN the meanwhile I fixed
the application where this was happening.

Riccardo


Ivan Vučica

unread,
Apr 25, 2012, 7:24:22 AM4/25/12
to Riccardo Mottola, Fred Kiefer, discuss...@gnu.org
I think the point is that this flag triggers additional debug output.




_______________________________________________
Discuss-gnustep mailing list
Discuss...@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnustep



--
Ivan Vučica - iv...@vucica.net


0 new messages