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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:35:08+00:00 2026-06-05T20:35:08+00:00

I’m currently doing the calculator app that has the graph functionality. So then, I

  • 0

I’m currently doing the calculator app that has the graph functionality. So then, I have this button in my Calculator and wired it up on my Calculator2ViewController. Also, I wired this button to another UIViewController named GraphViewController and named the segue’s identifier to be showGraph. Below is the code for my segue.

- (GraphViewController *)graphViewController {
    return [self.splitViewController.viewControllers lastObject];
}

- (IBAction)graphPressed {

     if ([self graphViewController]) {
     [[self graphViewController] setProgram:self.brain.program];
     }

     else {
     [self performSegueWithIdentifier:@"showGraph" sender:self];
     }
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    [segue.destinationViewController setProgram:self.brain.program];
}

There, so no errors and warnings. But when I try to run the app, and press Graph button, the app crashes and get this on my console.

2012-06-18 11:08:17.272 Calculator2[1135:f803] -[Calculator2ViewController graphPressed:]: unrecognized selector sent to instance 0x6c38850
2012-06-18 11:08:17.273 Calculator2[1135:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Calculator2ViewController graphPressed:]: unrecognized selector sent to instance 0x6c38850'

Kindly enlighten me with this as to why is this happening and how can I do this on a better way. Thanks!

EDIT:
Changed - (IBAction)graphPressed to - (IBAction)graphPressed:(id)sender. The segue works now. However, I have this notification on my console (which is kind of scary)

2012-06-18 11:30:02.955 Calculator2[1260:f803] nested push animation can result in corrupted navigation bar
2012-06-18 11:30:03.308 Calculator2[1260:f803] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
2012-06-18 11:30:03.309 Calculator2[1260:f803] Unbalanced calls to begin/end appearance transitions for <GraphViewController: 0x6e458d0>.
  • 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-05T20:35:09+00:00Added an answer on June 5, 2026 at 8:35 pm

    graphPressed and graphPressed: are different methods. One has an argument parameter, the other doesn’t. You have implemented it as:

    -(IBAction)graphPressed
    

    But you may have declared the function in the header as:

    -(IBAction)graphPressed:(id)sender
    

    Which it (rightfully) sees as two completely separate functions. Now, you can actually declare and implement it without any parameters (-(IBAction)graphPressed) or with parameters (-(IBAction)graphPressed:(id)sender) but what matters is that it is consistent in both declaration and implementation. The declaration and implementation must be the same.

    Just a tip, it is a best practice to always declare IBActions as -(IBAction)myButtonWasPressed:(id)sender because this lets you know what button was pressed (via the sender parameter) and it allows you to have multiple buttons that fire off the same event and still be able to tell which was pressed.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have some data like this: 1 2 3 4 5 9 2 6

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.