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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:10:54+00:00 2026-06-17T23:10:54+00:00

I know the unrecognized selector to instance message is very common but I can’t

  • 0

I know the unrecognized selector to instance message is very common but I can’t seem to find what’s causing it in my project.
I’m trying to basically segue from one controller to another when a particular button is tapped. I define the segue in storyboard. The buttons however are not created in storyboard, the buttons are created programmatically in a view controller, which is then inherited by the controller that I’m trying to segue from. Here’s the code of what I’m trying to do: First this is part of my ButtonViewController.m which has the button and it this controller that I’m inheriting

UIButton *EButton=[UIButton buttonWithType:UIButtonTypeCustom];
[EButton setFrame:CGRectMake(0, 450, 106, 60)];
[EButton setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin];
[EButton setImage:[UIImage imageNamed:@"test1.png"] forState:UIControlStateNormal];
[EButton setImage:[UIImage imageNamed:@"test2.png"] forState:UIControlStateHighlighted];
[EButton setEnabled:YES];
[EButton addTarget:self action:@selector(EButtonPressed) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:EButton];
-(IBAction)EButtonPressed:(id)sender
{
[self performSegueWithIdentifier:@"WorldtoE" sender:self];
}

Now, I inherit this ButtonViewController.m in my WorldViewController. (Reason for this is, I need this button in different controller throughout my app and would prefer to just make changes once in case I need to). Now, the button is created perfect when I’m running the app, but as soon as I tap on it, I get this error: Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[WorldViewController EButtonPressed]: unrecognized selector sent to instance
I even tried defining -(IBAction)EButtonPressed:(id)sender in my WorldViewController .h file and have also tried includingg the whole ibaction function in my .m file but I still get the same NSInvalidArgumentexception when I tap on the button. What am I doing wrong? And yes I have given the segue the same title in storyboard.

  • 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-17T23:10:55+00:00Added an answer on June 17, 2026 at 11:10 pm

    Replace line:

    [EButton addTarget:self action:@selector(EButtonPressed) forControlEvents:UIControlEventTouchUpInside];
    

    to:

    [EButton addTarget:self action:@selector(EButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i know, this is strange but, -[NSNull _isNaturallyRTL]: unrecognized selector sent to instance 0x20dfcd8
Trying to use CIColorMap filter, but getting run-time error [NSImage _feImage]: unrecognized selector sent
Know this might be rather basic, but I been trying to figure out how
I know you can not set a key value dynamically, but what about the
I get the error 012-02-10 13:54:52.570 HelloWorld[14275:10103] -[HelloWorldViewController buttonPressed]: unrecognized selector sent to instance
I know that Phonegap has an event for back button, but it's only available
I know that this sort of question has been asked here before, but still
Anyone know how I can make a login button in Ruby on Rails for
i know this is a stupid question but i d'ont know how to do
I know there are lots of tools on the net that can make our

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.