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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:52:59+00:00 2026-05-28T00:52:59+00:00

I have an iOS-App which uses ARC. I don’t use InterfaceBuilder, all UI is

  • 0

I have an iOS-App which uses ARC. I don’t use InterfaceBuilder, all UI is generated manually. In that app I have several UIViewControllers with SubViewControllers. Those ViewControllers a tied together from a menu (-ViewController) who pushes them on the stack.

My problem is, that memory doesn’t get freed when switching between the ViewControllers.

Is it wrong to keep references to the SubViewControllers like this?

@property (nonatomic, strong) UIViewController subViewController1; 
@property (nonatomic, strong) UIViewController subViewController2;

viewDidUnload never gets called. Has anyone a good example how to build a clean view hierarchy?

  • 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-28T00:53:00+00:00Added an answer on May 28, 2026 at 12:53 am

    This most likely has nothing to do with ARC. viewDidUnload is only called on a view controller when the view property is released / set to nil and this typically only happens if the app receives a memory warning.

    Try triggering a memory warning in the simulator and see if that causes your viewDidUnload method to fire. If it does then everything is fine. If not, you are probably over-retaining your views somehow, perhaps by assigning them to other strongly retained properties.

    There are exceptions to the view-retaining policy, for example the UINavigationController frees up views in its view controller stack if they aren’t frontmost, but it does that by simply setting the view of its child controllers to nil when they’re covered by another controller’s view.

    If you want your views to be released when they aren’t onscreen, either set the controller’s view property to nil in the viewDidDisappear: method, or stop retaining the view controllers when their views aren’t onscreen and just create fresh controller instances each time you need to display them (that way both the controller and view will be released when not in use).

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

Sidebar

Related Questions

guys :) I have an iOS alarm app, which uses UILocalNotification-s to schedule the
I have an iOS app which use the ffmpeg library, and iOS should compile
I have an iOS app which I need to upload the binary of. From
I currently have an iOS app that allows people to submit content to our
I'm attempting to make an iOS app communicate with a server that uses Bonjour
I'm making an iOS app which is OpenFeint enabled. I have managed to get
I have a jQuery Mobile web app which targets iOS and Android devices. A
I have an Xcode 4 project that has my iOS app and a static
I'm writing an iPhone app which uses a keypad that includes a decimal point.
I have an ios app that has a target of both iphone and ipad.

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.