Re: question about null
Re: question about null
- Subject: Re: question about null
- From: Dominik Pich <email@hidden>
- Date: Wed, 28 Feb 2007 21:03:53 +0100
[value EqualToString:@"<null>"] !? :)
Well as Joar said it outputs <null> if it is nil or "<null>"...
apart from that _I_ seem to remember that nil values print "(null)"!?
Am Feb 27, 2007 um 11:58 PM schrieb Glenn Zelniker:
I am using a SQLite database and I have a query that returns a
string that may be stored in the database as NULL (not nil or
NSNull -- rather, the NULL value that's specific to SQL). I am
trying to detect the NULL return value programatically. When I
NSLog the value to the Run Log, it prints out as <null>. How can I
test for this condition programatically? I've tried
if (value == nil)
if (value = NULL)
if ([value isEqualToString:@""]);
if (value == [NSNull null]);
and none of these seems to work. I'm puzzled. Perhaps the SQL part
of my explanation is a red herring. Let me rephrase. I have an
NSString called *value. If I do the following:
NSLog(@"%@", value),
I get the following output in the Run Log: <null>
How can I test "value" to catch the condition where value != nil
and yet logging value results in <null> ?
Glenn Zelniker
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden