title: Change the image of a specific button pressed in a UITableview
body: <p>I have a dynamic tableview which has a prototype cell with a button that, when pressed, plays a song. </p>
  
  <p>I'd like for the background image on the button to change to a "stop" icon when the user presses the button to play the song, and for it to change to a "play" icon when the user presses it once again to stop the song.</p>
  
  <p>To accomplish this I've been trying to use: 
  <code>[self.beatPlayButton setBackgroundImage:[UIImageimageNamed:@"play.png"]forState:UIControlStateNormal];</code></p>
  
  <p>My issue is that I haven't figured out how to change only the button in the row that is being pressed since I'm using prototype cells. I've been hoping to find a method like <code>didSelectObjectAtRow:atIndexPath:</code> because <code>didSelectRowAtIndexPath:</code> will fire when the row is pressed, but not a button on it (unless I'm mistaken). Maybe I should be using a tag? I'm not sure. Any pointers would be greatly appreciated.</p>
  
  <p>EDIT: 
  My code is outside of <code>didSelectRowAtIndexPath</code>.</p>
  
  <p>Here is sample code -</p>
  
  <pre><code>- (IBAction)playStopBeat:(UIButton*)sender event:(id)event {
      NSSet *touches = [event allTouches];
      UITouch *touch = [touches anyObject];
      CGPoint currentTouchPosition = [touch locationInView:self.tableView];
      NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint: currentTouchPosition];
      if([self.audioPlayer isPlaying])
      {
          [self.beatPlayButton setBackgroundImage:[UIImage imageNamed:@"play.png"]forState:UIControlStateNormal];
          [self.audioPlayer stop];
          self.isPlaying = NO;
          self.audioPlayer = nil;
      }
      else {
  
          if (indexPath.row == 0) {
              [self.beatPlayButton setImage:[UIImage imageNamed:@"stop.png"] forState: UIControlStateNormal];
          }
          else if (indexPath.row == 1){
              [self.beatPlayButton setBackgroundImage:[UIImage imageNamed:@"stop.png"]forState:UIControlStateNormal];
          }
          else if (indexPath.row == 2){
  ...
  //code to play song
  </code></pre>