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 8627861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:23:17+00:00 2026-06-12T08:23:17+00:00

i have custom UITableViewCell, i have subclassed the UITableViewCell: MyCustomCell.h MyCustomCell:UITableViewCell and then i

  • 0

i have custom UITableViewCell, i have subclassed the UITableViewCell:

MyCustomCell.h

MyCustomCell:UITableViewCell

and then i have also a xib file for this custom cell, all work fine, i can show all information, and image i have added on the cell, but i want detect a touch when the user touch on the uiimageview, so i have tried in this way:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

static NSString *CellIdentifier = @"MasterView";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil) {
    cell = [[MasterViewCell alloc] init];
    NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"MasterViewCustomCellImage" owner:self options:nil];
    cell = (MasterViewCell *)[nib objectAtIndex:0];
    //NSLog(@"Nuova Cella");
}

[self configureCell:cell atIndexPath:indexPath];

return cell;
}

 - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
 {
NSManagedObject *managedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];

UIImageView *thumbnailImage = (UIImageView *)[cell viewWithTag:1007];
[thumbnailImage setImage:[managedObject valueForKey:@"myImage"]];

if (thumbnailImage) {

    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(detectTouchImage)];
    [longPress setMinimumPressDuration:1.0];
    [thumbnailImage setUserInteractionEnabled:YES];
    [thumbnailImage addGestureRecognizer:longPress];
}

 }

-(void)detectTouchImage
{
 NSLog(@"Image Pressed");
 }

but i can’t understand why don’t work, it enter in the thumbnailImage if, but there don’t detect any gesture on the image…anyone can help me? i have tried it on ios 5 and ios 6, but don’t work…

  • 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-06-12T08:23:18+00:00Added an answer on June 12, 2026 at 8:23 am

    Just made test project to verify where is the problem.
    Completely working example is here on GitHub. Download and play with it. TableViewCell has custom UIImageView with UILongPressGestureRecognizer attached to it. Everything is working just fine. Long press on any image and UIIAllertView pops up. So, your code with UILongPressGestureRecognizer seems to be OK. Problems is in some other part of your project which you don’t expose.

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

Sidebar

Related Questions

I have custom UITableViewCell . It contains UITextLabel . When I press this cell
I have subclassed UITableViewCell to make a custom cell for a tableView. I add
I have a subclassed UITableViewCell and now I also need a custom delete button
I am making a custom uitableviewcell class and inside this cell I have a
I have subclassed UITableViewCell for a custom cell view along the lines as follows:
I have a custom UITableViewCell created in IB. All my cells will have this
I have a custom UITableViewCell subclass. I have set the contentView of my cell
Similar to this question I have a custom subclass of UITableViewCell that has a
I have a custom cell (subclass of UITableViewCell) with a textView inside of it.
I have a custom UITableViewCell which is part of a navigation controller. The cell

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.