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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:11:24+00:00 2026-06-09T13:11:24+00:00

I set up my user interface in an xib file and got everything working

  • 0

I set up my user interface in an xib file and got everything working pretty well. But the xib file was pretty cluttered, so I decided to try to create some of the buttons/bars/etc. programmatically instead. I can get them to show up fine, but I’m doing something wrong with the selectors.

With an instructions button on the xib file, for instance, I just used the mouse to connect the instructions button with the giveInstructions method in the .h file, and everything was fine. But when I try it programmatically, like so:

UIBarButtonItem *instr = [[UIBarButtonItem alloc] initWithTitle:@"Instructions" 
                                                          style:UIBarButtonSystemItemDone target:nil action:@selector(giveInstructions:)];

I get an unrecognized selector sent to instance error. What am I doing wrong?

  • 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-09T13:11:25+00:00Added an answer on June 9, 2026 at 1:11 pm

    Seeing as you fixed the target problem, it is most likely that “giveInstructions” doesn’t exist, at least not in this class’s implementation.

    If you have declared

    - (void)giveInstructions:(id)sender;
    

    In your .h, it is imperative that you have a matching implementation in your .m file, e.g.:

    - (void)giveInstructions:(id)sender{
        //my code here
    }
    

    If you have done this already, then the only other thing I can think of that could be wrong is that in your @selector(giveInstructions:) the colon may be unnecessary if you don’t have a sender, or any other arguments passed from the method.

    Note: When calling @selector if the method you are calling is 1 character different from its actual declared name you will get this error because the selector doesn’t exist.

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

Sidebar

Related Questions

I am trying to create a user interface using XAML. However, the file is
I've set the identifier (under User interface item identifier) to a string value but
In my deploy-file I set the group to www-data: set :user, root set :group,
I'm trying to create an user interface like the one is presented in App
I am working on the graphical user interface of a machine. It uses comboboxes
I'm trying to create a user interface similar to the iTunes source list or
I have a n-tier application based on pretty classic different layers: User Interface, Services
This is not an Eclipse-programming question, but rather a question about the Eclipse user-interface
I would like to ideally set up a user interface for designing emails that
I want to set reminder to calendar without user interface. means i have NSDate

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.