title: dataWithContentsOfURL return value not nil when URL empty
body: <p>i have a problem using <code>dataWithContentsOfURL</code>.
  I'm loading some images from the internet in a loop. 
  The Problem is: if the image at the URL doesn't exist, <code>dataWithContentsOfURL</code> does NOT return nil as expected. The apple reference says it returns nil if <code>NSData</code> could not be created.
  Here's the Code:</p>
  
  <pre><code>NSString *TermineImgFileName = nil;
  NSString *TermineImgPath = nil;
  NSURL *TermineImgURL = nil;
  NSData *TermineImg = nil;   
  for (deviceTermineHighInt; deviceTermineHighInt &lt;= serverTermineHighInt; deviceTermineHighInt++) {
      TermineImgFileName = [NSString stringWithFormat:@"Termine%i.png", deviceTermineHighInt];
      TermineImgURL = [rootURL URLByAppendingPathComponent:TermineImgFileName];
      TermineImg = [NSData dataWithContentsOfURL:TermineImgURL];
      if (TermineImg != nil) {
          TermineImgPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:TermineImgFileName];
          [TermineImg writeToFile:TermineImgPath atomically:YES];
          updateCount += 1;
          NSLog(@"File %@ saved", TermineImgFileName);
      }
      else {
          NSLog(@"Write Error");
      }               
      TermineImg = nil;
  }
  </code></pre>
  
  <p>Do you know why the method doesn't return nil if the file at the URL doesn't exist?</p>
  
  <p>And a second question: Does it make sense to use the Strings, <code>NSURL</code> and <code>NSData</code> as i did? I thought for memory reasons it would be the best way.</p>
  
  <p>Thank you in advance,
  Nikos</p>
  
  <p>Edit: The variables for the loop are defined before the code, the loop works fine. Also the variable <code>rootURL</code> is a constant defined in the header. The URL is built fine and it works.</p>