title: Cast after conformsToProtocol check
body: <p>I'm just trying to get a deeper understanding of Objective C.</p>
  
  <p>Why do I have to cast before the call to avoid a warning? Isn't this a piece of cake for the compiler? Are there any dynamic aspects that I'm missing?</p>
  
  <pre><code>if ([a.class conformsToProtocol:@protocol(P1)])
  {
    [(id&lt;P1&gt;)a p1Message];
  }
  </code></pre>
  
  <p>I mean, I understand it in a C/C++ point of view, but after all I'm using an Objective C compiler and I don't like casts. :) </p>