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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:46:54+00:00 2026-06-06T16:46:54+00:00

I am relatively new to Objective-C and I am coming from a Java background,

  • 0

I am relatively new to Objective-C and I am coming from a Java background, thus I find the notion of pointers and not-that-well explained compilation errors quite daunting.

I have a class that implements a delegate with the jsonControllerDidLinkedInAuth method. Whenever the delegator send a message to this class, passing itself and a (NSURL *)url, I am trying to assign the url to a property authUrl, when this operations finishes call the performSegueWithIdentifier, which in turn executes the prepareForSegue (as far as my understanding of this is concerned).

This doesn’t seem to work, as I am receiving a:

App[3278:13517] * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[UINavigationController setUrlAddress:]: unrecognized selector sent to instance 0x6acab00’

error message that terminates the application with SIGABRT.

Both of the methods reside in the same class, which is a UINavigationController and points to another UINavigationController. The compiler points me at the [vc setUrlAddress:self.authUrl]; of the second method.

- (void)jsonControllerDidLinkedInAuth:(JsonController *)controller :(NSURL *)url {
    authUrl = url;
    if (authUrl != nil) {
        [self performSegueWithIdentifier:@"LinkedInAuth" sender:self];
    } else {
        NSLog(@"Auth URL is null");
    }
}


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"LinkedInAuth"]) {
        // Get destination view
        LinkedInViewController *vc = [segue destinationViewController];
        NSLog(@"The auth url from prepareForSegue in SignupViewControlle: %@", self.authUrl);
        [vc setUrlAddress:self.authUrl];
    }
}

What seems to be the problem is that for some reason I cannot access the authUrl property of the class I currently am. I tried with authUrl, [self authUrl] and self.authUrl but none of this seem to do the job.
Properties are synthesized, but I have also noticed a little hint: “UINavigationController setUrlAddress”, shouldn’t this be a LinkedInViewController like defined in the method above? I tried casting (LinkedInViewController)[segue destinationViewController], but then I get a message notifying me that you cannot cast onto a pointer.

Any help would be highly appreciated. Thanks for reading.

Edit 1: The NSLog just above the setUrlAddress does return the self.authUrl. I am assuming it must be some sort of a visibility problem, but I am not sure how to solve this.

  • 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-06T16:46:55+00:00Added an answer on June 6, 2026 at 4:46 pm

    If your view controller is embedded in a UINavigationController, segue.destinationViewController refers to that navigation controller. This is what you could use:

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    
            if ([[segue identifier] isEqualToString:@"LinkedInAuth"]) {
                UINavigationController *navigationController = (UINavigationController *)segue.destinationViewController;
                LinkedInViewController *linkedInViewController = [[navigationController viewControllers] lastObject];
                linkedInViewController setUrlAddress:self.authUrl];
            }
    }
    

    And if you have more than 1 segue that transitions to a view controller embedded in a UINavigationController, I usually add this to the beginning of prepareForSegue:sender:

    if ([segue.destinationViewController isKindOfClass:[UINavigationController subclass]])
            id vc = [[(UINavigationController *)segue.destinationViewController viewControllers] lastObject]
    

    Now vc contains the view controller you’re actually interested in, so you don’t have to copy and paste the casting for every segue.

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

Sidebar

Related Questions

Note: I'm relatively new to Objective-C and am coming from Java and PHP. Could
fairly new to Objective-C and iOS development (coming from PHP) and I have a
I'm relatively new to the world of Objective-C and have a class that I've
I am relatively new to Objective C/iOS development so I realize that this may
I'm new to Windows Phone and C#, enjoying the change from Objective-C and Java.
I am relatively new to Objective-C / iPhone programming, and have only created single
I'm relatively new to Objective-C and really don't know much about it yet, so
I'm relatively new to Objective-C + Quartz and am running into what is probably
Being relatively new to programming--think Programming in Objective-C by Kochan, Chapter 15--I'm wondering if
I'm relatively new to Objective C and while I've been trucking right along writing

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.