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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:19:31+00:00 2026-05-17T18:19:31+00:00

I have a UITableView with custom cells. Inside each cell is 2 views. Each

  • 0

I have a UITableView with custom cells. Inside each cell is 2 views. Each view has a UIGestureRecognizer attached to handle tap events. When the view is tapped, I send a message to a UINavigationController to push a detail view. This scenario works fine until I actually scroll the table. After the table is scrolled, the app crashes when the user taps on one of the views inside of a cell. For example, I can load the app, click on a view in the 2nd cell, and get the detail view to be pushed onto the screen properly. From there, I navigate back to the table, scroll to the bottom, back to the top, and tap the same view. From there, the app crashes with an unrecognized selector error. Here is my setup for the gesture (in viewDidLoad):

UITapGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self 
                                                                          action:@selector(handleTap:)];
[self.view addGestureRecognizer:recognizer];
recognizer.delegate = self;
[recognizer release];

And here is the method that is invoked:

-(void)handleTap:(UITapGestureRecognizer *)sender{
    NSLog(@"Handling tap on ArticleTileViewController");
    ArticleViewController *vc = [[ArticleViewController alloc] initWithArticleData:self.articleDataArray];
    PROJECTAppDelegate *appDelegate = (PROJECTAppDelegate *)[UIApplication sharedApplication].delegate;

    [appDelegate.navController pushViewController:vc animated:YES]; 
}[appDelegate.navController pushViewController:vc animated:YES]; 
    }

Finally, here is the stack trace I get in the console:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType handleTap]: unrecognized selector sent to instance 0x607ba30'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x02839b99 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x0298940e objc_exception_throw + 47
    2   CoreFoundation                      0x0283b6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x027ab2b6 ___forwarding___ + 966
    4   CoreFoundation                      0x027aae72 _CF_forwarding_prep_0 + 50
    5   UIKit                               0x0057f060 -[UIGestureRecognizer _updateGestureWithEvent:] + 727
    6   UIKit                               0x0057b8bf -[UIGestureRecognizer _delayedUpdateGesture] + 47
    7   UIKit                               0x00580152 _UIGestureRecognizerUpdateObserver + 637
    8   UIKit                               0x00581464 _UIGestureRecognizerUpdateGesturesFromSendEvent + 51
    9   UIKit                               0x0032a844 -[UIWindow _sendGesturesForEvent:] + 1292
    10  UIKit                               0x003263bf -[UIWindow sendEvent:] + 105
    11  UIKit                               0x00309cb4 -[UIApplication sendEvent:] + 447
    12  UIKit                               0x0030e9bf _UIApplicationHandleEvent + 7672
    13  GraphicsServices                    0x02f07822 PurpleEventCallback + 1550
    14  CoreFoundation                      0x0281aff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    15  CoreFoundation                      0x0277b807 __CFRunLoopDoSource1 + 215
    16  CoreFoundation                      0x02778a93 __CFRunLoopRun + 979
    17  CoreFoundation                      0x02778350 CFRunLoopRunSpecific + 208
    18  CoreFoundation                      0x02778271 CFRunLoopRunInMode + 97
    19  GraphicsServices                    0x02f0600c GSEventRunModal + 217
    20  GraphicsServices                    0x02f060d1 GSEventRun + 115
    21  UIKit                               0x00312af2 UIApplicationMain + 1160
    22  PROJECT                                0x00002459 main + 121
    23  PROJECT                                0x000023d5 start + 53
    24  ???                                 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException

‘

EDIT: After testing with this for a while, I’ve determined that only the views that are visible on the screen at the time will fire the event. Everything else crashes with the above error. Possibly related to this unanswered question?

Here is my header declaration (iVars and properties omitted for clarity:

@interface ArticleTileViewController : UIViewController<UIGestureRecognizerDelegate> {

}

-(void)handleTap:(UITapGestureRecognizer *)sender;
  • 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-17T18:19:31+00:00Added an answer on May 17, 2026 at 6:19 pm

    Basically this problems means that you are sending a message to an object that does not recognize the message at all, ie the method is missing.

    Your selector creation is incorrect it should be:

    UIGestureRecognizer *recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
    

    and

    - (void) handleTap:(UITapGestureRecognizer *)sender {
    

    –UPDATE–

    recognizer.delegate = self;
    

    I apologize for asking, but are you sure that ‘self’ actually has the method handleTap:?

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

Sidebar

Related Questions

I have a UITableView with two custom cells and each of them has a
I have a UITableView with custom cells. The cells containing one UITextView each and
I have an UITableView showing custom view cells that I've designed in interface builder.
I just have a quick best practice question regarding custom cells in a UITableView.
Hi i have a working UITableViewController and UITableView with custom cells but i want
I have a custom cell with a uitextfield inside. I want to hide the
I have a custom UITableView cell that sports an Image, and a headline. I
I have a UITableView cell that is going to have a variable size depending
I have a UIView with a UITableView for a subview. The UIView has an
I have a view with a custom slider. We are using a subclass of

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.