How do i attached a tap event to a uiwebview?
<p>I am trying to attach a UITapGestureRecognizer to a webview that i am creating and then remove that view when a user taps the webview. Below is my sample code. What am i doing wrong? Thanks!</p>

<pre><code>- (void) setupPuzzle1
{
puzzleDuration--;
//Create object circle
UIImageView *circleView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"red-circle.png"] highlightedImage:[UIImage imageNamed:@"red-circle.png"]];

UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeImage:)];
recognizer.numberOfTapsRequired = 1;
recognizer.numberOfTouchesRequired = 1;
recognizer.delegate = self;

[circleView addGestureRecognizer:recognizer];

[recognizer release];

int x = rand()%280;
int y = rand()%420;

circleView.frame = CGRectMake(x,y,40,40);
[self.view addSubview:circleView];

if (puzzleDuration &gt; 0)
{
    [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(setupPuzzle1) userInfo:nil repeats:NO];
}

}



#pragma mark - UITapGestureRecognizer methods


- (void)removeImage:(UITapGestureRecognizer *)recognizer
{
NSLog(@"Remove Image");
[[recognizer view] removeFromSuperview];
}
</code></pre>

<p>@end</p>
