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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:32:01+00:00 2026-06-06T15:32:01+00:00

I have a SourceViewController and a DesViewController , there’s a variable in DesViewController :

  • 0

I have a SourceViewController and a DesViewController , there’s a variable in DesViewController : @property ( nonatomic , assign , readwrite ) NSString* name ;

but here’s a problem when I call the method in SourceViewController :

-(void)performSegueWithIdentifier:(NSString *)identifier sender:(id)sender {
    UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil ] ;
    DestinationViewController* desViewController = [storyboard instantiateInitialViewController ] ;
    desViewController.name = @"haah" ;
    [self presentViewController:desViewController animated:YES completion:nil ] ;
}

the output :

'NSInvalidArgumentException', reason: '-[SourceViewController setName:]: unrecognized selector sent to instance 0x6a0d7c0'

Can anyone help me, please?

  • 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-06T15:32:03+00:00Added an answer on June 6, 2026 at 3:32 pm

    As it is right now, the viewcontroller you instantiate doesnt seem to be of class DestinationViewcontroller (since your initial viewController doesn’t seem to be of that class). So it doesnt have that property. You have to instantiate the correct class (see below).
    Also check if you synthesized the property in implementation of DestinationViewcontroller.

    And on a side note: though you may want to simply assign the string variable to a new value, most of the times you’d want to use copy instead of assign on NStrings. Also, the readwrite is not necessary since its the default behaviour.
    So, better change your property declaration thusly:

    @property (nonatomic, copy) NSString *name;
    

    And in implementation check if you synthesize for example like this:

    @synthesize name = _name;
    

    And in your dealloc:

    [_name release];
    

    Also, consider using ARC if you stat a new project.

    Now, if you make your viewController a DestinationViewcontroller, it should work.
    Best way to get is would be

    DestinationViewcontroller *dc = [storyboard instantiateViewControllerWithIdentifier:@"identifier of your desviewcontroller"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have different files with same name, in different directories. In these files there are
Have such a problem, hope you'll help me.. Can't find anywhere. Here is the
Have you ever obfuscated your code before? Are there ever legitimate reasons to do
have not tested on windows. but in ubuntu when u disconnect from the network,
Have converted devise new session from erb to Haml but doens't work, this is
Have searched the database but need to specifically sum(of hours flown or days off)in
Have a look at one of my websites: moskah.com The problem is that it
Have a really weird one here. The app has two targets, just to be
Have the following code. The height is variable so the height of the floating
Have a xml data like <Items><Item><name>test1</name></Item><Item><name>test2</name></Item></Items> Looks like jaxb cannot unmashall this when defining

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.