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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:55:51+00:00 2026-06-12T01:55:51+00:00

If I have a strong reference to a view in my view hierarchy, do

  • 0

If I have a strong reference to a view in my view hierarchy, do I have to set it to nil in viewDidUnload or is it taken care of by ARC?

  • 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-12T01:55:52+00:00Added an answer on June 12, 2026 at 1:55 am

    There is so much misinformation in the two earlier answers I’m going to clarify exactly what the situation is. Note that these are relative to the DEPLOYMENT target, not to whether you use the iOS6 SDK to build):

    • you don’t worry about self.view – the UIViewController manages that

    • top level objects – ie those NOT contained in another object – must be strong

    • other objects should use weak (the system nil’s the ivar when they are released preventing crashes from trying to use a released object)

    • for Deployment on pre-iOS6 devices, use viewDidUnload to release top level objects and anything else you want to. NOTE: dealloc is NOT called after this – the next message you get may well be viewDidLoad, when the memory problem that caused the message goes away and the view reappears)

    • for iOS6 and later, don’t use viewDidUnload (see edit below), use didReceiveMemoryWarning if you want to free memory not related to views or the other UI objects.

    • dealloc is called in all releases. With ARC, you don’t call super, and you don’t release memory as you did in the old days.

    EDIT: From the iOS6 SDK UIViewController class description:

    viewDidUnload
    Called when the controller’s view is released from
    memory. (Deprecated in iOS 6.0. Views are no longer purged under
    low-memory conditions and so this method is never called.)

    What Apple does do is remove the backing store – the cached pixels. They found this removed most of the consumed memory, and that viewDidUnload was poorly implemented (they told us this at WWDC 2012).

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

Sidebar

Related Questions

Suppose I have a weak reference to a car which has an ordinary (strong)
I have read about the different types of reference. I understand how strong, soft
I have a strong typed View <%@ Control Language=C# Inherits=System.Web.Mvc.ViewUserControl<MyPortal.Domain.Kite> %> In the view
We know that string is a reference type , so we have string s=God
I currently have a Javascript function that uses a string to reference an object
I have class with back reference: public class Employee : Entity { private string
I have a class whose constructor takes a const reference to a string. This
Is it really important to know algorithms to build mobile applications? I have strong
Using t-sql, how can i find if all SQL Logins have strong passwords on
I have a strong database background but very little practical experience with ms sql

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.