title: Problem with NSRange
body: <p>I'm having a problem with NSRange. Here is my code:</p>
  
  <pre><code>NSRange range = [[[NSHTTPCookie requestHeaderFieldsWithCookies:[[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:[NSURL URLWithString:cookie]]] objectForKey:@"Cookie"] rangeOfString:@"x"];
  NSLog(@"%f", range.length);
  if (range.length &gt;= 1) {
      NSLog(@"Do Something");
  } else {
      NSLog(@"AUTHING");
  }
  </code></pre>
  
  <p>Console output: </p>
  
  <pre><code>0.000000
  Do something
  </code></pre>
  
  <p>And then the second time I run through the code:</p>
  
  <pre><code>0.000000
  AUTHING
  </code></pre>
  
  <p>What the hell is going on? NSNotFound I think it was does not work and I'm not the only person finding this problem so using it is not a solution.</p>
  
  <p>Thanks for any help.</p>
  
  <p>Cheers</p>
  
  <p>Edit: I tried using NSLog(@"%d", range.length) but it gives incorrect output the first time it runs through, the second time it runs through it is correct. I've tried using NSNotFound thinking that the strange output is due to it being NSNotFound but it didn't trigger</p>