title: How to check the NULL value in NSString in iOS?
body: <p>I have an <code>NSString</code> and I want to check if it has a <code>NULL</code> value. If it does, then the <code>if</code> condition should execute. Else it should execute the <code>else</code> condition.</p>
  
  <p>Below is the code which I am using:</p>
  
  <pre><code>if ([appDelegate.categoryName isEqual:[NSNull null]])
  {
      select = [[NSString alloc] initWithFormat:@"select * FROM ContentMaster LEFT JOIN Category ON ContentMaster.CategoryID=Category.CategoryID where ContentMaster.ContentTagText='%@'", appDelegate.tagInput];
  }
  else
  {
      select = [[NSString alloc] initWithFormat:@"select * FROM ContentMaster LEFT JOIN Category ON ContentMaster.CategoryID=Category.CategoryID LEFT JOIN Topic ON ContentMaster.TopicID=Topic.TopicID where ContentMaster.ContentTagText='%@' &amp;&amp; Category.CategoryName='%@' &amp;&amp; Topic.TopicName='%@'", appDelegate.tagInput, appDelegate.categoryName, appDelegate.topicName];
  }    
  </code></pre>
  
  <p>It always executes the <code>else</code> condition, and never the <code>if</code> condition, even when the value is <code>NULL</code>.</p>