title: Checking to see if an optional protocol method has been implemented
body: <p>Does anyone know the best way to check to see if an optional protocol method has been implemented.</p>
  
  <p>I tried this:</p>
  
  <pre><code>if ([self.delegate respondsToSelector:@selector(optionalProtocolMethod:)] )
  </code></pre>
  
  <p>where delegate is:</p>
  
  <pre><code>id&lt;MyProtocol&gt; delegate;
  </code></pre>
  
  <p>However, I get an error saying that the function <code>respondsToSelector:</code> is not found in the protocol!</p>