title: Getting index in NSMutableArray of selected or tapped image
body: <p>I am developing an app where I add images to an <code>NSMutableArray</code> and  display them in an image view.</p>
  
  <p>My problem is that I will don't know how to get the index of the selected or tapped image in my app.</p>
  
  <pre><code>FrontsCards=[[NSMutableArray alloc]initWithObjects:@"cloub1.png",@"cloub2.png",@"cloub3.png",@"cloub4.png", nil];
  
  for(int m=0; m&lt; [FrontsCards count];m++)
  {
      NSString *imageName=[FrontsCards objectAtIndex:m];
  
      NSString *fullImageName=[NSString stringWithFormat:@"%@",imageName];
  
      int padding=25;
  
      CGRect imageViewFrame=CGRectMake(scrollView.frame.size.width*m+padding, scrollView.frame.origin.y, scrollView.frame.size.width-2*padding, scrollView.frame.size.height);
  
      ImgView=[[UIImageView alloc]initWithFrame:imageViewFrame];
  
      [ImgView setImage:[UIImage imageNamed:fullImageName]];
  
      [ImgView setContentMode:UIViewContentModeScaleAspectFill];
  
  
      [scrollView addSubview:ImgView];
  
  
      UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTapImgView:)];
      doubleTap.numberOfTapsRequired = 2;
      doubleTap.delegate = self;
  
      [self.ImgView addGestureRecognizer:doubleTap];
  
      self.ImgView.userInteractionEnabled=YES;    
  }
  
  
  CGSize scrollViewSize=CGSizeMake(scrollView.frame.size.width*[FrontsCards count], scrollView.frame.size.height);
  [scrollView setContentSize:scrollViewSize];
  [self.view addSubview:scrollView];
  </code></pre>
  
  <p>What should I do in my tap gesture recognizer to get the index of the image?   </p>
  
  <pre><code>- (void)doubleTapImgView:(UITapGestureRecognizer *)gesture
  {
       NSLog(@"double-tap");
  }
  </code></pre>