title: Check if valid url so i can pass it to an NSURL?
body: <p>I want to check if an <code>NSString</code> is a valid URL so I can parse it to an <code>NSURL</code> variable... is there an easy way to do this? :)</p>
  
  <p><strong>CRASH</strong>
  For some reason the app crashes when checking.....</p>
  
  <pre><code>NSURL *shortURL = [[NSURL alloc] initWithString:data];
  if(shortURL == nil)
  {
      NSLog(@"INVALID");
  }
  else {
      NSLog(@"COOOL");
  }
  </code></pre>
  
  <p>The console gives me this error.....</p>
  
  <blockquote>
    <p><strong>* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*</strong> -[NSURL initWithString:relativeToURL:]: nil string parameter'
    2010-03-01 19:24:14.797 Snippety[8289:5e3b] Stack: (
        8307803,
        2419510843,
        8391739,
        8391578,
        2898550,
        3152497,
        12262,
        12183,
        27646,
        2662269,
        2661144,
        2454790485,
        2454790162
    )</p>
  </blockquote>