title: Objective-C class_conformsToProtocol() bug?
body: <p>I have come across some strange behavior in my iPhone Objective-C app.</p>
  
  <p>I am using some code to test an object:</p>
  
  <pre><code>if (!class_conformsToProtocol([someVar someFunctionThatReturnsAClass], @protocol(MyProtocol)))
       [NSException raise:@"Invalid Argument" format:@"The variables returned by 'someFunctionThatReturnsAClass' Must conform to the 'myProtocol' protocol in this case."];
  </code></pre>
  
  <p>Oddly, when I have a class that looks like this:</p>
  
  <pre><code>@interface BaseClass : NSObject&lt;MyProtocol&gt;
  
  ...
  
  @end
  
  @interface SubClass : BaseClass
  
  ...
  
  @end
  </code></pre>
  
  <p>And when I call this fragment: <code>class_conformsToProtocol([SubClass class], @protocol(MyProtocol))</code>, it returns <code>NO</code>.</p>
  
  <p>Also, this code fails:</p>
  
  <pre><code>class_conformsToProtocol([NSString class], @protocol(NSObject)); // also returns NO
  </code></pre>
  
  <p>While this code returns <code>YES</code>:</p>
  
  <pre><code>[NSString conformsToProtocol:@protocol(NSObject)];
  </code></pre>
  
  <p>Is there anything I am missing in the docs? 
  Or is this a bug of some sort? (I am on iOS 4.2 if that matters any).</p>