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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:13:15+00:00 2026-05-28T00:13:15+00:00

I have a modal view controller that attempts to set an flag (an NSNumber

  • 0

I have a modal view controller that attempts to set an flag (an NSNumber property) of the source view controller that called it in its prepareForSegue method. It fails to build with the error “No known instance method for selector ‘setGoToEditNewNote:'”. Here is the code:

Source View Controller .h:

@property (strong, nonatomic) NSNumber *goToEditNewNote;

Source View Controller .m:

@synthesize goToEditNewNote;
...

- (void)viewDidLoad
{
[super viewDidLoad];
    // clear the flag
    goToEditNewNote = [[NSNumber alloc] initWithBool:FALSE];
...

- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
    if ([goToEditNewNote boolValue] == TRUE) {
        goToEditNewNote = FALSE;
        [self performSegueWithIdentifier: @"editNote" sender: self];
...

Modal View Controller .h:

Modal View Controller .m:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"done"]) 
    {
        [self done];
        [[segue destinationViewController] setGoToEditNewNote:TRUE]; <<< get error here
    }
}

I suspect the problem may have to do with goToEditNewNote not being retained when the modal view is loaded, but i don’t understand why not. I have set other properties such as the managedObjectContext in a similar way with success. Please be as specific as possible in your answer as I am a novice with ARC. Thanks – Tom

  • 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-05-28T00:13:15+00:00Added an answer on May 28, 2026 at 12:13 am

    destinationViewController is of the id type which doesn’t contain a goToEditNewNote property. You probably want to cast destinationViewController to the SourceViewController type. This is usually a warning but it sounds like you’re treating all warnings as errors (I do this too).

    Your -prepareForSegue:sender: should look something like this.

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        if ([[segue identifier] isEqualToString:@"done"]) 
        {
            [self done];
            SourceViewController *sourceViewController = (SourceViewController *)[segue destinationViewController];
            [sourceViewController setGoToEditNewNote:[NSNumber numberWithBool:YES]];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a modal view controller that is presented from my main view, I
I have an issue where I have a view controller that redraws its contents
I have a modal view controller that creates core data changes in it's own
I have a modal view controller that I put onto screen using presentModalViewController:animated .
I have a modal view controller that initiates a process. If I dismiss the
In my app I have a function that presents a modal view controller when
I have a modal view controller that takes another UIViewController as delegate. My doubt
I have a root view controller that opens up a new modal view controller.
I have an iPhone app that displays a modal view controller. The modal view
I launch a modal view controller and in its init I have the following

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.