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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:13:31+00:00 2026-06-08T04:13:31+00:00

I have an app that when loads, loads a tab based app whereby all

  • 0

I have an app that when loads, loads a tab based app whereby all tabs work fine. In the first tab however the view loaded has a whole bunch of buttons. I have written methods of these buttons so when pressed they push a new subview (.xib) and this works fine.

However, when in these new subviews I have a back button which has its own method. I want this button to remove the view and return back to the orignal view. Here is the code from FirstViewController.m.

Bear in mind that this File holds all the code even though it handles different .xib files. basically it pushes FirstView first, then when button is pressed it will push E87view.xib, the code for the .xib is still within the firstviewcontroller file.

-(IBAction) backButtonPressed {
    [self showAll];
    backButton.hidden = 1;

    for (UIView *subview in [self.view subviews]) {
        [subview removeFromSuperview];
    }
    [self showAll];
}

-(IBAction) E87Pressed {
    //[self hideAll];

    E87view *e87view = [[E87view alloc] initWithNibName:@"E87view" bundle:[NSBundle mainBundle]];

    [self.navigationController pushViewController:e87view animated:YES];
    [self.view addSubview:e87view.view];
}

So just to reiterate, when i press the button E87 on the first view that’s loaded FirstView.xib it will push the new view E87view.xib. However when I press the back button on this newly loaded E87view it will access the above function and remove the view but also remove all the setup I had from FirstView.xib essentially leaving me with an empty app.

Hope this makes sense I can ramble a bit.

Regards,

Lewis

  • 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-08T04:13:32+00:00Added an answer on June 8, 2026 at 4:13 am

    Instead of removing every individual subviews, just remove the ViewController from the navigation controller using

    [self.navigationController popViewControllerAnimated: YES];
    

    And this line is unnecessary

    [self.view addSubview:e87view.view];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that is based on a tab bar view with a
I have an app that has 2 tabs. Each tab loads an xml file
I currently have this workflow in a tab based app: Tab1 loads... ViewOne :
I have a tab view that loads a table view for each of the
I have a tab bar controller view that loads a record from an api
I have a Grails app that loads its data from xml files and delivers
I have an app that when I click a button loads a new TabItem
I have a Cordova app that runs the jQuery mobile framework and loads pages
I have a flash app that plays movies. It loads subtitles and subtitle times
I have an app that starts with a tableview (from a xib) that loads

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.