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

The Archive Base Latest Questions

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

NB: I saw a few questions being asked in this front, but none seem

  • 0

NB: I saw a few questions being asked in this front, but none seem to have clarified my doubt.

Pre iOS6, all outlets, heavy resources like images and sounds were set to nil in viewDidUnload. Post iOS6, this is no more the case as views are not unloaded anymore. The system calls didReceiveMemoryWarning and this is the new recommended place to put such resource neutralizations.

So what if the code needs to support everything above iOS4? On devices running iOS 4 and 5, viewDidUnload will still be getting called. And in devices running iOS6, only didReceiveMemoryWarning will be called.

Does this mean I have to replicate the code in both places? Is calling a common method in both places a good approach? Please provide your inputs or approaches on how this is being handled in the industry.

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

    Yes, if you’re supporting iOS versions prior to 6.0, you should remove anything that’s dependent upon the view and its controls in viewDidUnload. It’s a function of the iOS running on the device. Obviously, if the device is running 6.0 or later, the view won’t be unloaded, though. Regardless, you should purge caches and the like in didReceiveMemoryWarning.

    You should not replicate the code in the two methods as that’s unnecessary. Do view-related cleanup in viewDidUnload and cache-related purging in didReceiveMemoryWarning. And, most importantly, do not copy view-specific cleanup from viewDidUnload (such as setting IBOutlet references to nil, something that Interface Builder used to add to our code) into didReceiveMemoryWarning. If you do and if you get a memory warning in iOS 6, you’ll lose IBOutlet references for a view that has not been removed.

    See iOS 6 – viewDidUnload migrate to didReceiveMemoryWarning?

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

Sidebar

Related Questions

I searched SO and saw a few questions posted on the topic, but I
I saw only a few questions related BlackBerry, but I think knowledgeable members are
I am using https with php and have a few security questions: +I saw
I've seen several questions about password protecting pages, but none of them seem to
I'm searching for this for quite some time now. I saw few similar questions
I have read a lot of these but I have a few questions that
i saw some similar questions on the site but none of them really helped
I saw many threads with this tittle, but no one really speak about reuse
I have a few questions about Qt. I already know that Qt and OpenGL
First of all, I know there are a few other StackOverflow questions about this

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.