title: Objective C: Sending arguments to a method called by a UIButton
body: <p>I have a method that is being called when a UIButton is clicked. When I create the button I want it to store an NSTimer as an argument. </p>
  
  <p>This is the timer and the creation of the UIButton. How would I add in the timer to be sent down to the method? I've tried <code>withObject:timer</code> but it gives me a warning and crashes at runtime. </p>
  
  <pre><code>NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:(0.009) target:self selector:@selector(moveStickFig:) userInfo:stickFig repeats:YES];
  [stickFig addTarget:self action:@selector(tapFig:andTime:) forControlEvents:UIControlEventTouchUpInside];
  </code></pre>
  
  <p>This is the method I'm sending it down to:</p>
  
  <pre><code>-(void) tapFig:(id)sender andTime:(NSTimer *)timer
  </code></pre>
  
  <p>I've also tried <code>[stickFig performSelector:@selector(tapFig:andTime) withObject:nil withObject:timer]</code> after I defined the UIButton, but that also results in a warning and crashes. </p>