question about null
question about null
- Subject: question about null
- From: Glenn Zelniker <email@hidden>
- Date: Tue, 27 Feb 2007 17:58:50 -0500
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