title: How to check if NSURL contains NSString null?
body: <p>I use the following code to get a NSString from a NSDictionary and then cast it into NSUrl:</p>
  
  <pre><code>NSURL * url = [NSURL URLWithString:[self.item objectForKey:@"website"]];
  </code></pre>
  
  <p>The NSDictionary <code>self.item</code> comes from a web server and it's correctly filled using JSON data. All the other objects inside the NSDictionary work perfectly fine.</p>
  
  <p>But sometimes the web server passes a website url with the text "null" because the object has no website filled in. From debugging i learned that the NSURL object can contain a url with the text "null". But how do i prevent this, or how can i write an if statement that checks this?</p>
  
  <p>I tried the following:</p>
  
  <pre><code>NSString * niks = [eventUrl absoluteString];
  if(niks == @"null")
  {
      UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Event" message:@"Event heeft geen website" delegate:nil cancelButtonTitle:@"Oke" otherButtonTitles:@"Oke", nil];
      [message show];
  }
  else
  {
      [webView loadRequest:[NSURLRequest requestWithURL:eventUrl]];
      NSLog(@"%@",eventUrl);
  }
  </code></pre>
  
  <p>But this doesn't work, it always passes the url directly to the webview. Can someone set me in the right direction?</p>