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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:59:07+00:00 2026-06-12T11:59:07+00:00

I am in a viewController, lets call it vcA and I call a second

  • 0

I am in a viewController, lets call it vcA and I call a second one vcB, using

[self presentModalViewController:vcB animated:YES];

once vcB is loaded is there any way to obtain a reference to vcA?

Yes, I know that I can subclass vcB and add a property to it. I am just asking if there is some native iOS method/property/whatever that already does that.

I am on a navigationController app.

Thanks.

  • 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-12T11:59:08+00:00Added an answer on June 12, 2026 at 11:59 am

    If it’s for single fire use and there is not a lot of collaboration I tend to prefer blocks over delegation as it’s seems a bit tidier.

    For example if it was just to call back when you have finished using the secondViewController I would:

    Add a block property to the SecondViewController

    @property (nonatomic, strong) void (^onCompletion)(void);
    

    Then in the firstViewController when you create the secondViewController

    - (void)showSecondViewController;
    {
      SecondViewController *viewController = [[SecondViewController alloc] init];
      viewController.onCompletion = ^{
        [self dismissViewControllerAnimated:YES completion:nil];
      };
    
      [self presentViewController:viewController
                     animated:YES
                   completion:nil];
    }
    

    Then in the secondViewController when you are finished

    - (IBAction)doneTapped;
    {
      if (self.onCompletion) {
        self.onCompletion();
      }
    }
    

    If you need a return value then just modify the block to accept an argument

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

Sidebar

Related Questions

I have a viewController (lets call it vcA) and this viewController has a NSArray
in one of my viewcontroller, lets say A, I have the following: OnbViewController *on
I have one ViewController, in this i have added one Custom UIView named as
I have a ViewController class called GamePlay. In GamePlay there is a nested class
I have an array which contains 2 types of items (lets call them type
Quick problem: I have an UITabBarController with 2 navigation controllers [lets call them Left
When I transition from one view controller (let's call it MasterViewController ) to another
My goal is, to have a subclassed UIView (lets call it infoView ) designed
So lets say that I am in viewcontroller, C and I want to transition
My ViewController has a dataSource , which in my case has to fetch the

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.