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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:35:45+00:00 2026-05-26T15:35:45+00:00

I have some uiview, one call another in this way: From first uiview: MyViewController

  • 0

I have some uiview, one call another in this way:

From first uiview:

MyViewController *contr1 = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
[self.view addSubview:contr1.view];

From second uiview:

MyViewController2 *contr2 = [[MyViewController2 alloc] initWithNibName:@"MyViewController2" bundle:nil];
[self.view addSubview:contr2.view];

now in the third uiview i want to return back on the first updating it ( calling viewDidLoad ). how can i do?

  • 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-26T15:35:46+00:00Added an answer on May 26, 2026 at 3:35 pm

    First of all – you are doing it wrong.

    Since you are using view controllers present them modally or push them:

    MyViewController2 *contr2 = [[MyViewController2 alloc] initWithNibName:@"MyViewController2" bundle:nil];
    [self presentModalViewController:contr2];
    

    If you want to dismiss modal controllers exactly to your root view controller you should obtain a pointer to it in the controller you are currently using and send it a message to dismiss every modal view that there is on it.

    - (IBAction)doHomePage:(id)sender {
      MyAppDelegate *appDelegate = (MyAppDelegate *)[UIApplication sharedApplication].delegate;
      [appDelegate.navigationController.rootViewController dismissModalViewControllerAnimated:YES];
    }
    

    Also instead of viewDidLoad: you might want to use viewWillAppear: or viewDidAppear:.

    Sorry beforehand if there are some typo errors in the code since I wrote it by hand.

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

Sidebar

Related Questions

i have faced some problem while navigating from one class to another with the
I have refactored some UIView sub-classes into a static library. However, when using Interface
I have some buttons in an UIView. My problem is, that they get cut
I have a NIB with a UIView that contains some UILabels, UIButtons etc. and
I have a subclass s of UIView. I want to put some buttons and
I have some classes layed out like this class A { public virtual void
Gentleones, I've got a UIImageView that I have in a UIView. This particular UIImageView
I have a Card class subclassed from UIView and a Deck class from NSObject.
I want to create transition animation within a UIView (not from one UIView to
I have a single UIView for drawing any one of a set of items.

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.