Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7658657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:13:49+00:00 2026-05-31T13:13:49+00:00

I am populating a UITableView with cells containing a UIImageView subview. I would like

  • 0

I am populating a UITableView with cells containing a UIImageView subview. I would like to detect touches on the image view, so I am also adding a gesture recognizer to it. However, nothing is getting called. Here is my code:

UIImageView *delete = [[UIImageView alloc] initWithFrame:CGRectMake(1.0, 8.0, 33.0, 33.0)];
delete.image = [UIImage imageNamed:@"Delete.png"];
delete.userInteractionEnabled = YES;
delete.contentMode = UIViewContentModeCenter;

UIGestureRecognizer *gesture = [[UIGestureRecognizer alloc] initWithTarget:self action:@selector(deleteTapped)];
gesture.delegate = self;

[delete addGestureRecognizer:gesture];
[self.cellView addSubview:delete];

Note: I am technically adding the image view to a container which is then added to the the cell itself, hence [self.cellView addSubview:delete]. But I have had the same results adding the image view to the cell directly.

According to this answer on a similar post this is a known bug in iOS 5.0; the solution is to override a delegate method to force the gesture recognizer to begin:

The fix is to override -gestureRecognizerShouldBegin: in the gesture recognizer’s delegate and return YES. This bug should be fixed in a future version of iOS 5.x. This is only safe as long as you are not using the new UITableViewCell copy/paste API’s.

I’ve tried this, but the delegate method never gets called. I’ve set the delegate property (see above) and implemented <UIGestureRecognizerDelegate> as follows:

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
    NSLog(@"gesture delegate method called");
    return YES;
}

Does any one have an idea why this still wouldn’t be working? Or perhaps what this status of this bug is in iOS 5.1?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T13:13:50+00:00Added an answer on May 31, 2026 at 1:13 pm

    try to return YES for this delegate methode - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;

    and if you want to detect the tap action use UITapGestureRecognizer

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIViewController with a UITableView outlet that I am populating with cells
I have a UItableView controller containing images. I also have a refresh button to
I’m populating a UITableView based on the values of an NSMutableArray. This table view
I am populating a UITableViewController's UITableView through code only. At the bottom of the
I m parsing a json feed and populating my table view.if my parsed value
I am populating a standard UITableViewCell with an image as follows: cell.imageView.image = [UIImage
I have been populating a UITable view cell with the data fetched from a
I have a UITableView I'm populating with data from CoreData. I have a data
I'm working on populating the table view with an array of dictionaries. The contents
I'm populating an UITableView with MYSQL data from and external DB on my host,so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.