title: How to detect if NSString is null?
body: <p>I have a piece of code that detects if a <code>NSString</code> is <code>NULL</code>, <code>nil</code>, etc. However, it crashes. Here is my code:</p>
  
  <pre><code>NSArray *resultstwo = [database executeQuery:@"SELECT * FROM processes WHERE ready='yes' LIMIT 0,1"];
  for (NSDictionary *rowtwo in resultstwo) {
  
  NSString *getCaption = [rowtwo valueForKey:@"caption"];
  
  if (getCaption == NULL) {
  theCaption = @"Photo uploaded...";
  } else if (getCaption == nil) {
  theCaption = @"Photo uploaded...";
  } else if ([getCaption isEqualToString:@""]) {
  theCaption = @"Photo uploaded...";
  } else if ([getCaption isEqualToString:@" "]) {
  theCaption = @"Photo uploaded...";
  }
  
  }
  </code></pre>
  
  <p>And here's the error:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception '<code>NSInvalidArgumentException</code>', reason: '<code>-[NSNull isEqualToString:]</code>: unrecognized selector sent to instance <code>0x3eba63d4</code>'</p>
  </blockquote>
  
  <p>Am I doing something wrong? Do I need to do it a different way?</p>