title: Invalid class returned from KVC - confusing for bool values
body: <p>The code is easy to understand, but output is not.</p>
  
  <p>Screen of xcdatamodel editor: </p>
  
  <p><img src="https://i.stack.imgur.com/xwaIR.png" alt="cl.ly/image/3U0P1W301K06"></p>
  
  <p>The type of <code>deleted</code> is <code>String</code>.</p>
  
  <pre><code>@interface Row : NSManagedObject
      (...)
      @property (nonatomic, retain) NSString * deleted;
  @end
  
  @implementation Row
      (...)
      @dynamic deleted;
  @end
  </code></pre>
  
  <p>Somewhere else in code:</p>
  
  <pre><code>Row *row = [self.fetchedResultsController objectAtIndexPath:indexPath];
  
  NSString* fixedTypeDeletedClassString = NSStringFromClass([row.deleted class]);
  NSString* KVCDeletedClassString = NSStringFromClass([[row valueForKeyPath:@"deleted"] class]);
  
  NSLog(@"%@ is %@", row.deleted, fixedTypeDeletedClassString);
  NSLog(@"%@ is %@", [row valueForKeyPath:@"deleted"], KVCDeletedClassString);
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>2014-05-07 17:29:26.170 iOSplayground[20814:90b] false is __NSCFString
  2014-05-07 17:29:26.171 iOSplayground[20814:90b] 0 is __NSCFNumber
  </code></pre>
  
  <p>Why the class of the property is different?</p>
  
  <p>Class is different, but at least looks like properly casted, but there is a worse case:</p>
  
  <pre><code>2014-05-07 17:29:26.172 iOSplayground[20814:90b] true is __NSCFString
  2014-05-07 17:29:26.172 iOSplayground[20814:90b] 0 is __NSCFNumber
  </code></pre>
  
  <p>I've been fast prototyping without Row class at first, and used <code>NSManagedObject</code> with KVC, and I've lost a lot of time on debuging why there is a property of class that I didn't use.</p>