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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:20:47+00:00 2026-06-05T15:20:47+00:00

The project currently has a UIviewController called Dashboard that acts as the main view

  • 0

The project currently has a UIviewController called “Dashboard” that acts as the main view of all the application. This main view consists of two subviews on top of it, kind of like a splitview. The left side of the main (left view) has multiple buttons. The right side (right view) will display the content of the selected button of the left.

When a button is pressed it will create a new instance of the view that is going to display like this :

vcMySchedule_iPad *vcSchedule = [[vcMySchedule_iPad alloc] initWithNibName:@"vcMySchedule_iPad" bundle:nil];
ncDashboard = [[UINavigationController alloc] initWithRootViewController:vcSchedule];

ncDashboard.navigationBar.barStyle = UIBarStyleBlackOpaque;

ncDashboard.view.frame = self.vwRightPanel.bounds;

[self.vwRightPanel addSubview:ncDashboard.view];

The thing is that when pressing another button it will display another view, but the memory of the previous one called still remains, and the dealloc of the previous view never gets called.

I’m not using a split view cause the left side has a button that when pressend it will move the left side to the left and the right side will move the the left to view completely.

Is there any approach to this?

Updated with some images…

Main (MainViewController):
enter image description here

Pressed Course Catalog:

vcCourseCatalog_iPad *vcCourse = [[vcCourseCatalog_iPad alloc] initWithNibName:@"vcCourseCatalog_iPad" bundle:nil];
ncDashboard = [[UINavigationController alloc] initWithRootViewController:vcCourse];

ncDashboard.navigationBar.barStyle = UIBarStyleBlackOpaque;

ncDashboard.view.frame = self.vwRightPanel.bounds;

[self.vwRightPanel addSubview:ncDashboard.view];

enter image description here

When selecting a row form the table it displays the detail and if the user press the button the view is displayed max.

enter image description here

I think I may have been calling the new views wrong perhaps. Where are the objects released?

  • 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-05T15:20:49+00:00Added an answer on June 5, 2026 at 3:20 pm

    Without more information, I can’t give solid advice, but check the following:

    1. Are you using ARC? If not, remember that you must explicitly release all references before something is dealloc’d.
    2. Do you keep ahold of a reference to the subview anywhere else? If you are still referencing it somewhere (especially in ARC), it will stick around. Circular references are evil here.
    3. Are you removing the subview from it’s superview before you replace it with the new one? You’d be surprised how often it is something as simple as this.

    EDIT:

    In response to below, about you not using ARC, its plainly obvious that 1) is your problem. You are not releasing references. In this case, it seems quite obvious here:

    vcCourseCatalog_iPad *vcCourse = [[vcCourseCatalog_iPad alloc] initWithNibName:@"vcCourseCatalog_iPad" bundle:nil]; ncDashboard = [[UINavigationController alloc] initWithRootViewController:vcCourse];
    
    ncDashboard.navigationBar.barStyle = UIBarStyleBlackOpaque;
    
    ncDashboard.view.frame = self.vwRightPanel.bounds;
    
    [self.vwRightPanel addSubview:ncDashboard.view];
    

    that you are allocating a vcCourseCatalog_iPad and a UINavigationController, without ever releasing them. Optimally, you’d autorelease the vcCourseCatalog_iPad, and release the navigation controller when you swap it out.

    Your code ought to look something like this:

    vcCourseCatalog_iPad *vcCourse = [[[vcCourseCatalog_iPad alloc] initWithNibName:@"vcCourseCatalog_iPad" bundle:nil] autorelease];
    
    if(ncDashboard)
    {
        //do any sort of removal from views here
        //[ncDashboard.view removeFromSuperview];
        [ncDashboard release];
    }
    ncDashboard = [[UINavigationController alloc] initWithRootViewController:vcCourse];
    ncDashboard.navigationBar.barStyle = UIBarStyleBlackOpaque;
    ncDashboard.view.frame = self.vwRightPanel.bounds;
    
    [self.vwRightPanel addSubview:ncDashboard.view];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our project has two application contexts: application-context.xml application-context-test.xml Currently each file has duplicate bean
I'm currently working on a project that has a svn repository. I'm used to
I'm currently working on a project that has a sizable amount of both client
I'm working on a project that currently has zero users but we would like
I have a PHP application that currently has 5k users and will keep increasing
The project currently I'm working has the following code in the view: <%= product.provider.name
I have a Java project that currently has a lot of JARs in its
Currently my project has the following simple tree: ./Makefile.am ./configure.ac ./README ./src/main.cpp ./src/Makefile.am ./bin
Our project currently uses Silverlight to consume an Odata service. This has made life
I'm currently fixing a JSP project and it currently has a seemingly random collection

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.