title: Selectors with arguments in Obj-C
body: <p>So basically I have a big list of buttons that's present dropdowns and other things, and these buttons are created dynamically. So to capture the value for the appropriate button's data, I need to set it's action selector to a function that takes 1 extra parameter.</p>
  
  <p>For example, using this selector on this dropdown, with the method below, returns an error that the selector is unrecognized. How can I get the selector to recognize the parameter I'm passing in? (In this case the variable 'name')</p>
  
  <p>The apple docs at:
  <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocSelectors.html#//apple_ref/doc/uid/TP30001163-CH23-SW1" rel="nofollow noreferrer">http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocSelectors.html#//apple_ref/doc/uid/TP30001163-CH23-SW1</a></p>
  
  <p>On the last paragraph in the header 'The Target-Action Design Pattern', the Apple Docs <em>imply</em> that this can be done, but do not give an example of using a custom message, or maybe I'm just misunderstanding?</p>
  
  <pre><code>SEL sel = @selector(openDropdown:name:);
  [dropdownSelector addTarget:self action:sel forControlEvents:UIControlEventTouchUpInside];
  
  
  -(void) openDropdown: (NSString *) anotherArg : (id) sender {
   // Stuff here based on anotherArg
  }
  </code></pre>