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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:24:51+00:00 2026-05-15T22:24:51+00:00

I created a custom UItableviewcell added a button into its initWithStyle area: favoriteButton =

  • 0

I created a custom UItableviewcell

added a button into its initWithStyle area:

favoriteButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain];
        favoriteButton.backgroundColor = [UIColor clearColor];
        [favoriteButton setTitle:@"Play" forState:UIControlStateNormal];
        [favoriteButton addTarget:self action:@selector(favoriteClick:) forControlEvents:UIControlEventTouchUpInside];
        favoriteButton.center = self.center;

set its frame and layout in:

- (void)layoutSubviews {
    [super layoutSubviews];
    CGRect contentRect = self.contentView.bounds;
    CGFloat boundsX = contentRect.origin.x;
    CGRect frame;

    frame = CGRectMake(boundsX+200, 44, 40, 40);
    favoriteButton.frame = frame;

}

and then in my tableviewcontroller.m file I use that tableviewcell and have the user click tap to go to the action within that tableviewcontroller.m code

-(void)favoriteClick:(id)sender// forEvent:(UIEvent*)event
{
    NSLog(@"click");

}

however when i tap the button I get an unhandled exception:

2010-07-24 16:06:02.197 Film Fest[10342:40b] -[ProgramGuideCell favoriteClick:]: unrecognized selector sent to instance 0x6e63ff0
2010-07-24 16:06:02.200 Film Fest[10342:40b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ProgramGuideCell favoriteClick:]: unrecognized selector sent to instance 0x6e63ff0'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x02a56919 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x02ba45de objc_exception_throw + 47
    2   CoreFoundation                      0x02a5842b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x029c8116 ___forwarding___ + 966
    4   CoreFoundation                      0x029c7cd2 _CF_forwarding_prep_0 + 50
    5   UIKit                               0x00301e14 -[UIApplication sendAction:to:from:forEvent:] + 119
    6   UIKit                               0x0038b6c8 -[UIControl sendAction:to:forEvent:] + 67
    7   UIKit                               0x0038db4a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
    8   UIKit                               0x0038c6f7 -[UIControl touchesEnded:withEvent:] + 458
    9   UIKit                               0x00579070 _UIGestureRecognizerUpdateObserver + 3687
    10  CoreFoundation                      0x02a37d1b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
    11  CoreFoundation                      0x029cc987 __CFRunLoopDoObservers + 295
    12  CoreFoundation                      0x02995c17 __CFRunLoopRun + 1575
    13  CoreFoundation                      0x02995280 CFRunLoopRunSpecific + 208
    14  CoreFoundation                      0x029951a1 CFRunLoopRunInMode + 97
    15  GraphicsServices                    0x030b42c8 GSEventRunModal + 217
    16  GraphicsServices                    0x030b438d GSEventRun + 115
    17  UIKit                               0x0030fb58 UIApplicationMain + 1160
    18  Film Fest                           0x00002170 main + 102
    19  Film Fest                           0x00002101 start + 53
)
terminate called after throwing an instance of 'NSException'

I dont see what Im doing wrong here…

  • 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-15T22:24:52+00:00Added an answer on May 15, 2026 at 10:24 pm

    Try returning IBAction instead of void on your selector, and put the selector in the ProgramGuideCell instead of tableviewcontroller.

    -(IBAction)favoriteClick:(id)sender// forEvent:(UIEvent*)event
    {
        NSLog(@"click");
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 469k
  • Answers 469k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you're using g++ (gcc) and don't mind the code… May 16, 2026 at 2:34 am
  • Editorial Team
    Editorial Team added an answer use timestamps when your executable starts call: startTime = System.nanoTime();… May 16, 2026 at 2:34 am
  • Editorial Team
    Editorial Team added an answer The optimization you are observing is probably nothing to do… May 16, 2026 at 2:34 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.