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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:28:50+00:00 2026-06-15T18:28:50+00:00

So, I was reading this related SO , as it ended up being something

  • 0

So, I was reading this related SO, as it ended up being something I wanted to do as well.

I added a property to my destinationViewController’s header file:

@property (nonatomic, strong) NSString *incomingSegue;

And I’ve got it synthesized in the destinationViewController’s implementation file:

@synthesize incomingSegue = _incomingSegue;

I’ve added the following lines to my prepareForSegue method, for the sourceViewController (depending on which is triggering the segue):

[segue.destinationViewController setIncomingSegue:@"edit"];
[segue.destinationViewController setIncomingSegue:@"add"];

And, finally, I’ve got a process to check for which value is set in my destinationViewController’s implementation file:

if (_incomingSegue == @"add")
    {
        //snipped code here
    }
    else if (_incomingSegue == @"edit")
    {
        //snipped code here
    }

So, apparently I am missing something. When I try to perform the segue I get an error that shows up about 1000 times in SO, which makes it rather difficult to figure out which detail I’ve overlooked. This thing triggers (according to breakpoints) in my prepareForSegue method on my sourceViewController:

unrecognized selector sent to instance

Can I not use a literal string (@”string”) in place of a (NSString *), or is it something else throwing the error?

Update (solved):

More detailed description of my prepareForSegue method:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"editSegue"])
    {
        //snipped
        [segue.destinationViewController setIncomingSegue:@"edit"];
    }

    else if ([[segue identifier] isEqualToString:@"addSegue"])
    {
        //snipped
        DestinationViewController *dtv = (DestinationViewController *)[[segue destinationViewController]topViewController];
        [dvc setIncomingSegue:@"add"]
    }
}

Turns out, I had to use my declared DestinationViewController class object to set the value. Instead of just referencing the segue.destinationViewController as I did for the editSegue. I do not have a DestinationViewController class object declared for editSegue, so that one was/is working as intended.

  • 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-15T18:28:51+00:00Added an answer on June 15, 2026 at 6:28 pm

    You should add a condition around the line that sets the incoming segue:

    if ([segue.identifier isEqualToString:@"SegueToControllerThatSupportsIncomingSegue"]) {
        [segue.destinationViewController setIncomingSegue:@"edit"];
    }
    

    The idea is to call setIncomingSegue: only on the destination view controller that supports your added method.

    You should also change the code in the destination view controller to check string equality with isEqualToString:

    if ([_incomingSegue isEqualToString:@"add"])
    {
        //snipped code here
    }
    else if ([_incomingSegue isEqualToString:@"edit"])
    {
        //snipped code here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading this article: http://sqlserverpedia.com/wiki/Understanding_the_StackOverflow_Database_Schema and the writer wrote something special about the
after reading all the questions related to this I still can't seem to figure
This question sort of encompasses two problems (which may very well be inter-related) that
Reading this page , it says: ...the URI in a PUT request identifies the
Reading this article http://support.microsoft.com/kb/813878 I have a question: Where can I get ipseccmd.exe for
While reading this class BitmapFactory I noticed that almost all methods inside are static.
After reading this question, I need to clear up some things. IQueryable<Customer> custs =
After reading this article, it makes sense to rebase to gather changes from the
After reading this article I don't have a clear answer: http://palizine.plynt.com/issues/2010Oct/bypass-xss-filters/ Will browsers interpret
After reading this post I kinda felt in the same position as the guy

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.