title: How can I add a Gesture Recognizer to a series of subviews?
body: <p>I have a grid of subview images that are display on the screen; it's basically a series of images laid out on the screen in checker board manner. I simply want add gesture recognizers to each one of those image- subviews so that when the user touches one of the images subviews, I can retrieve the subview i.e. the coordinates, tag, etc. My view hierarchy goes like this: </p>
  
  <ol>
  <li>The super view</li>
  <li>A gridContainer view</li>
  <li>and each individual subview - with image</li>
  </ol>
  
  <p>After looking at the apple documentation it seems as though I should be able to add a gesture recognizer to the gridContainer view and each one of the subviews - with images - should inherit the gesture recognizer. So far this is what I've tried: I've alloc'ed init'ed the grid container view in the getter. Also, in the getter I called my createGesture method which is supposed to add a gesture recognizer to the gridContainer view. However I'm getting an error at runtime that's pointing to my action handleSingleTap method. It reads EXC_BAD_EXCESS.
  It's also worth noting that I don't want the view outside of my gridContainer view to respond to any touch event. Thanks in advance for any help.</p>
  
  <p>Here is the code I'm trying to implement:</p>
  
  <pre><code>- (UIView *)gridContainerView
  {
      if (!_gridContainerView)_gridContainerView = [[UIView alloc] init];
      [self createGesture];
      return _gridContainerView;
  }
  - (void)createGesture
  {
      UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc]
                                           initWithTarget:self.gridContainerView
                                           action:@selector(handleSingleTap:)];
      singleTap.numberOfTapsRequired = 1;
  
      [self.gridContainerView addGestureRecognizer:singleTap];
  }
  </code></pre>
  
  <p>If you need to see any additional code for this to make sense, please let me know.</p>
  
  <p>Edit: including the handleSingleTap method:</p>
  
  <pre><code>- (IBAction)handleSingleTap:(id)sender
  {
      CGPoint tapPoint = [sender locationInView:sender];
      NSLog(@"sender = %@",sender);
      NSLog(@"tappoint = %@", tapPoint);
  }
  </code></pre>