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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:46:56+00:00 2026-05-31T16:46:56+00:00

I have a BaseViewController, which is a subclass of UITabBarController, and set up my

  • 0

I have a BaseViewController, which is a subclass of UITabBarController, and set up my views in this view controller.

-(void)setUpViews
{
FirstController *mainViewController = [[FirstController alloc] initAssignment:delegate.currentAssignment withMutableArray:myArray];
UINavigationController *firstNavController = [[UINavigationController alloc] initWithRootViewController:mainViewController];


SecondController *secondViewController = [[SecondController alloc] initWithNibName:@"SecondController" bundle:nil];
UINavigationController *secondNavController = [[UINavigationController alloc] initWithRootViewController:secondViewController];


self.viewControllers = [NSArray arrayWithObjects:firstNavController, secondNavController,nil];

firstNavController.tabBarItem.image = [UIImage imageNamed:@"blablabla.png"];
firstNavController.tabBarItem.title = @"Stream";


secondViewController.tabBarItem.image = [UIImage imageNamed:@"blabla.png"];
secondViewController.tabBarItem.title = @"Favourite";
}

Now I have another view controller, I call it ViewHandlerController, a subclass of BaseViewController. in my viewDidLoad in this viewHandler, i invoke setUpViews which is declared in BaseViewController. in the first screen of my app, when a Login button is pressed, I instantiate my ViewHandlerController, and presented my tabcontroller succesfully with nav controllers by using.

[[[UIApplication sharedApplication].windows objectAtIndex:0] addSubview:viewControllerHandler.view];

Inside my app. there is a logout button. I am using NSNotificationCenter to call my logoutMethod which is declared in my first screen. My question is, in this logoutMethod, how can I release the previously allocated objects to avoid memory pressure since the user can log in again (logIn – logOut -logIn)? since I’m using ARC, is setting my ViewController to NIL will do all the clean up?

EDIT: is removing my ViewControllerHandler from superview and setting it to nil helps releasing its subviews too?

Cheers

  • 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-31T16:46:58+00:00Added an answer on May 31, 2026 at 4:46 pm

    Well, answer for your question (not ARC) – no, basicaly view controller doesn’t releases his properties when release. But you should nil your properties in viewDidUnload and (or) dealloc methods.

    If you use ARC, you should notice that some actions can retain your controller, and it can never be deleted in some cases. Watch for methods, which takes object for delegate, they may not using weak references

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

Sidebar

Related Questions

I'm having a little predicament switching between views, here. Alright, so, I have this
I have a custom UITableViewCell which is part of a navigation controller. The cell
Have a look at this pseudocode: void* magicpointer = malloc(OVER_NINE_THOUSAND); NSValue* v = [NSValue
I have added UITabButtonItem onto my view controller using following code. Could anyone please
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
Have converted devise new session from erb to Haml but doens't work, this is
have anyone can tell me what syntax error on this actionscript (actionscript3.0)? var rotY:
have Googled the cr*p out of this one so apologies if the answer is
Is it possible to have a ViewController use one nib, while my ViewController's subclass
I have a class called BaseViewController that inherits from UIViewController and a class called

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.