• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
question about null
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: question about null
      • From: Dominik Pich <email@hidden>
    • Re: question about null
      • From: Joar Wingfors <email@hidden>
  • Prev by Date: Re: API to convert string to number?
  • Next by Date: Re: question about null
  • Previous by thread: Re: API to convert string to number?
  • Next by thread: Re: question about null
  • Index(es):
    • Date
    • Thread