title: I'm writing a Button class in Objective-C with ARC -- How do I prevent Clang's memory leak warning on the selector?
body: <p>I'm writing a simple button class, something like this:</p>
  
  <pre><code>@interface MyButton : NSObject {
    id object;
    SEL action;
  }
  @property(strong) id object;
  @property SEL action;
  -(void)fire;
  @end
  
  
  @implementation MyButton
  
  @synthesize object, action;
  
  -(void)fire {
    [object performSelector:action];
  }
  
  @end
  </code></pre>
  
  <p>I get the following warning from Clang on <code>[object performSelector:action]</code>:</p>
  
  <pre><code>PerformSelector may cause a leak because its selector is unknown
  </code></pre>
  
  <p>After <a href="http://clang.llvm.org/docs/AutomaticReferenceCounting.html#family" rel="noreferrer">some research</a> I see that selectors can belong to families which have different memory requirements. The intention is for the action to return void, so it shouldn't cause any ARC difficulties and should fit in the <code>none</code> family.</p>
  
  <p>It looks like the relevant piece of preprocessor code I want is, or is a variant of:</p>
  
  <pre><code>__attribute__((objc_method_family(none)))
  </code></pre>
  
  <p>But where do I put that to tell Clang not to worry?</p>