title: How to get rid of the 'undeclared selector' warning
body: <p>I want to use a selector on an NSObject instance <em>without</em> the need for an implemented protocol. For example, there's a category method that should set an error property if the NSObject instance it's called on supports it. This is the code, and the code works as intended:</p>
  
  <pre><code>if ([self respondsToSelector:@selector(setError:)])
  {
      [self performSelector:@selector(setError:) withObject:[NSError errorWithDomain:@"SomeDomain" code:1 userInfo:nil]];
  }
  </code></pre>
  
  <p>However, the compiler doesn't see any method around with the setError: signature, so it gives me a warning, for each line that contains the <code>@selector(setError:)</code> snippet:</p>
  
  <pre><code>Undeclared selector 'setError:'
  </code></pre>
  
  <p>I don't want to have to declare a protocol to get rid of this warning, because I don't want all classes that may use this to implement anything special. Just by convention I want them to have a <code>setError:</code> method or property.</p>
  
  <p>Is this doable? How?</p>
  
  <p>Cheers,<br>
  EP</p>