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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:38:32+00:00 2026-06-17T09:38:32+00:00

I still haven’t grasped this transfer with the structure below. I have read many

  • 0

I still haven’t grasped this transfer with the structure below. I have read many posts, and have seen the same unanswered post by others, but no resolution.

I will try to simplify the question to make it easier for all.

The structure of the project is:
UITabbar with tab1 and tab2

Tab1 has a Nav controller–>ViewController1

Tab2 has a Nav controller –>ViewController2

In viewcontroller1 (tab1) I have object X.

In ViewCOntroller2 (tab2) I want to display object X.

Don’t worry about displaying, that’s the easy part.

enter image description here

Question: How do you pass object X from tab1 to tab2. (what is the general pattern).

If you want to do it using prepareForSegue, is this ok, or is there a better way.

If using prepareForSegue, where do you drag the segue to?

  1. The tabbarcontroller

    enter image description here

OR*****
2. to the second VC
enter image description here

Hopefully this is clear enough. With this in mind how would you perform the transfer?

Using the segue 1:
enter image description here

I tried doing this:

//(From View controller 1)

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
    if ([segue.identifier isEqualToString:@"CreateObjectXToDisplayObjectX"])

            ViewController2* vc2 = [[ViewController2 alloc] init];
            UITabBarController* tbc = [segue destinationViewController];
            vc2 = (ViewController2 *)[[tbc customizableViewControllers] objectAtIndex:1];
    //Crash here with with [MainNavigationControllerDesign setViewController1Delegate:]: unrecognized selector sent to instance 0x1064ef70'
            vc2.viewController1Delegate=self;
            vc2.objectXAtViewController2 = _objectXFromViewController1;
        }
    }

So, how is this Object X transfer accomplished?
Thank you in advance

  • 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-17T09:38:32+00:00Added an answer on June 17, 2026 at 9:38 am

    You don’t want to use segues in this way. Segues always instantiate new controllers when you go to them, but you already have these controllers embedded in the tab bar controller. If you were setting this up in code, I would say use a delegate, but if you set this up in IB, it’s hard to do that. From VC2, you can get a reference to VC1’s navigation controller with self.tabBarController.viewControllers[0]. VC1 will be that navigation controller’s topViewController, so, putting that together, and adding a cast, you can access VC1 like this:

    ViewController1 *vc1 = (ViewController1 *)[self.tabBarController.viewControllers[0] topViewController];
    

    Once you have that reference, you can access any of vc1’s properties. Don’t forget to import ViewController1.h into ViewController2’s .m file.

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

Sidebar

Related Questions

I have read many Forums on this topic but I still haven't found an
I've seen various other posts about this, but unfortunately I still haven't been able
I haven't yet implemented this, I'm still in the thinking stage, but I have
I've searched and read and still haven't found a concrete answer. Brief: I have
I've run accross this problem many times and still haven't found the solution or
I have been scratching my head all morning behind this but still haven't been
I've read a bunch of tutorials on this .hgignore topic but still haven't figured
I have done this before, but still haven't mastered it. I downloaded a font
I've read several different questions from SO about this already but still haven't been
I've read some posts about namespaces and autoload in php 5.3+, but still haven't

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.