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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:26:47+00:00 2026-05-12T06:26:47+00:00

What is the -(void)viewDidUnload is good for? Could I not just relase everything in

  • 0

What is the -(void)viewDidUnload is good for?

Could I not just relase everything in -dealloc? If the view did unload, wouldn’t -dealloc be called anyway?

  • 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-12T06:26:47+00:00Added an answer on May 12, 2026 at 6:26 am

    In addition to what has already been indicated, I wanted to elaborate more about logic behind -viewDidUnload.

    One of the most important reasons for implementing it is that UIViewController subclasses commonly also contain owning references to various subviews in the view hierarchy. These properties could have been set through IBOutlets when loading from a nib, or programmatically inside -loadView, for instance.

    The additional ownership of subviews by the UIViewController means that even when its view is removed from the view hierarchy and released to save memory, through which the subviews are also released by the view, they will not actually be deallocated because the UIViewController itself still contains its own outstanding retaining references to those objects as well. Releasing the UIViewController additional ownership of these objects ensures they will be deallocated as well to free memory.

    The objects that you release here are usually recreated and set again when the UIViewController view is re-loaded, either from a Nib or through an implementation of -loadView.

    Also note that the UIViewController view property is nil by the time this method is called.

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

Sidebar

Related Questions

A quick question, after viewDidUnload does the dealloc also get called? I am asking
- (void)viewDidUnload { self.GPSArray = nil; self.accelerometerArray = nil; self.headingArray = nil; self.managedObjectContext =
- (void)applicationDidFinishLaunching:(UIApplication *)application { // Create the navigation and view controllers RootViewController *rootViewController =
Many people say during a view controller's viewDidUnload method you must remove subviews by
I had thought I actually had a pretty good handle on the whole view
I having a problem with a Bad Exception that I could not locate at
In my .m file : (void)viewDidLoad { [super viewDidLoad]; /* Some codes for picker
This is my program - (void)viewDidLoad { [super viewDidLoad]; // Uncomment the following line
I have a UITableView with the following code: - (void)viewDidLoad { [super viewDidLoad]; parser
void (int a[]) { a[5] = 3; // this is wrong? } Can I

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.