title: Why does Length not work on a NSString?
body: <p>I am trying to check the length of string, but I get <code>unrecognized selector</code> when the code is executed and hits the <code>IF</code> statement.</p>
  
  <p><strong><em>THE VALUE IN THE DICTIONARY IS A STRING.</em></strong></p>
  
  <pre><code>NSString * checkString = [myDictionary objectForKey:@"somekey"];
      NSLog(@"length: %lu", (unsigned long)[checkString length]);
  
  if([checkString length]  &gt; 0){
  
  }
  </code></pre>
  
  <p>ERROR From console:</p>
  
  <blockquote>
    <p>length: 0<br>
    [__NSCFNumber length]: unrecognized selector sent to instance</p>
  </blockquote>
  
  <p><strong><em>For simplicity:</em></strong></p>
  
  <pre><code> NSString * checkString = @"my string"; //[myDictionary objectForKey:@"somekey"];
      NSLog(@"length: %lu", (unsigned long)[checkString length]);
  
      if([checkString length] &gt; 0){
  }
  </code></pre>
  
  <blockquote>
    <p>length: 9<br>
    [__NSCFNumber length]: unrecognized selector sent to
    instance</p>
  </blockquote>
  
  <p>Why?</p>