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

  • SEARCH
  • Home
  • 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 7987529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:10:32+00:00 2026-06-04T12:10:32+00:00

Im building an iphone app through xcode and objective c. building for ios5.0 min

  • 0

Im building an iphone app through xcode and objective c. building for ios5.0 min target.
I created a custom uitablecell and im loading this within a table in a view controller no problems. this cell contains a button. when the user taps this button within any of the cells i want it to call the same function within the view controller. The way i have done this in the past is by making the file owner of the custom cell the viewcontroller in question and then simply control drag the button into the view controller and place the ibaction function there. always works no problem. until now.

-[__NSCFString loadMerchant:]: unrecognized selector sent to instance 0x8689e50 2012-05-24 09:56:14.630 [3217:16103] * Terminating
app due to uncaught exception ‘NSInvalidArgumentException’, reason:
‘-[__NSCFString loadMerchant:]: unrecognized selector sent to instance
0x8689e50’

this is the error im getting. I am making sure that the function is not accidently linked to the wrong button, that the function isnt also in the cell.m by mistake and any other simple mistakes i can think of.

Does anyone know the correct way to accomplish what im trying to do?

edit: custom cell

@interface TimelineCell : UITableViewCell


@property (weak, nonatomic) IBOutlet UIButton *nameButton;


@end


@implementation TimelineCell


@synthesize nameButton;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self; }

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state }

@end 

below is the viewcontroller

 - (IBAction)loadMerchant:(id)sender;

 - (IBAction)loadMerchant:(id)sender { }

and thats it. crash happens when ever the button is tapped with above error

edit: dropping the link within the nib file and just maually add the action to the button seems to solve the issue but id still liek to know the cause of it if anyone can shed some light on that would be appreciated

made within cellForRowAtIndexPath

 UIButton *b = (UIButton*)[cell viewWithTag:1];
 [b addTarget:self action:@selector(loadMerchant:) forControlEvents:UIControlEventTouchUpInside];
  • 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-04T12:10:34+00:00Added an answer on June 4, 2026 at 12:10 pm

    what i ended up doing was tagging the button within the nib file and then in code adding the target through code in the cell set up in cellForRowAtIndexPath.

    UIButton *b = (UIButton*)[cell viewWithTag:1];
     [b addTarget:self action:@selector(loadMerchant:) forControlEvents:UIControlEventTouchUpInside];
    

    while this solves the problem I am still unsure as to why the link made through IB failed in the first place.

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

Sidebar

Related Questions

I'm building an iPhone app / web application, and I'm trying to think through
Building an iPhone app, using: Xcode 4.1 Base SDK iOS 4.3 Apple LLVM Compiler
I'm still noob with objective c code (PHP background). So I'm building this iphone
I'm building iPhone / iPad app with Xcode. now i want to take screenshot
I'm building an iPhone app, and my app copies a bunch of resources to
I'm building an iphone app and I've got a table view with some textfields
I'm building my iPhone app under SDK 3.1.3. My Base SDK and iPhone OS
I am building an iPhone app that will need to display info primarily in
I am building an iphone app which allows people to update an xml file
I'm working on building an iPhone app with Titanium Mobile 1.0 and I see

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.