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

The Archive Base Latest Questions

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

I have a container with 4 navigation buttons, each representing 4 individual child vc.

  • 0

I have a container with 4 navigation buttons, each representing 4 individual child vc. I have successfully implement the code to go from the container to the child vc using addchildviewcontroller however now I do not know how to go back.

Container VC: 4 Buttons navigating to 4 separate child view controllers.

When the button is clicked the current view is replaced by the view of the Child VC. Therefore the buttons are no longer visible. For this very reason the child VC has a home button specifically designed to return to the container VC where the 4 buttons are residing.

Example of 1 of 4 Buttons Calling a function to display child VC:

- (IBAction)btn_bus:(id)sender {   
   [self addMyController:businessVC_];
}

Adding Child View Controllers, function called when button is clicked:

-(void)addMyController:(UIViewController *)myController{
    [self addChildViewController:myController];
    [self.view addSubview:myController.view]; 
    [myController didMoveToParentViewController:self]; 

}

Question 1: How do you trap/perform functions on a child VC. For example how do I get the Home button on my Child VC to now cause the child vc to remove itself and once again show the container/nav screen?

Question 2: Where are these procedures to take place in the custom container VC or child VC?

Question 3: Is there in particular a guide or tutorial that shows how the relationship of IBAction and IBOutlet are managed in a Parent-Child Relationship?

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

    If you don’t want any animation, going back is done like this, with the code being in the parent view controller:

    -(void)removeChild:(UIViewController *) child {
        [child didMoveToParentViewController:nil];
        [child.view removeFromSuperview];
        [child removeFromParentViewController];
    }
    

    In the child controller, you would call it like this:

    -(IBAction) goBackToContainer {
        [(ParentClassNameHere *)self.parentViewController removeChild:self];
    }
    

    In general, adding and removing children should be done from the custom container controller. I’m not sure what you mean by your third question. IBActions and outlets belong to whichever controller’s view has the UI item in it. Your overall design is different than the way Apple does their container controllers. Containers like navigation and tab bar controllers don’t have a view to go back to except for the navigation or tab bar views — one of the chid views is always on screen. I don’t know why you’re doing a custom controller in this case, since its design seems pretty much like a tab bar controller.

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

Sidebar

Related Questions

I am using WordPress I have put an extra container in the navigation menu.
I have a horizontal navigation bar. Each button is a span with a background
I have an application that uses a UITabBarController as its outer container. Each tab
I have a navigation button that I use in each class and want to
I'm creating a tablet optimised application using fragments. I have a thin navigation fragment
I have a custom container view controller with 4 buttons. My goal is to
I have a container view controller that consists of a navigation view at top,
Overview I have an iOS project which contains 2 navigation controllers as shown in
I have two Entity classes: Order and OrderItem . Order contains a navigation property
I have container of geometrical entities. Let's assume there is circle, ellipse, line, arc.

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.