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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:45:11+00:00 2026-05-27T04:45:11+00:00

The root level view controller in my iPad application is a UISplitViewController. Thus, it

  • 0

The root level view controller in my iPad application is a UISplitViewController. Thus, it has 2 view controllers :

  • one master view controller (item 0 of the viewControllers property)
  • one detail view controller (item 1 of the viewControllers property)

The detail view controller is a custom view controller that I change depending on taps and events in my master view controller.

To change this detail view controller, I use the following code:

- (void)replaceSecondViewControllerBy:(UIViewController *)viewController {
    [[self.viewControllers objectAtIndex:1] dismissModalViewControllerAnimated:NO];
    NSArray *newVC = [NSArray arrayWithObjects:[self.viewControllers objectAtIndex:0], viewController, nil];
    self.viewControllers = newVC;
}

My problem is that when my app receives a memory warning event, the didReceiveMemoryWarning method is called for all my view controllers, except for former detail view controllers. And they’re not being deallocated because they still are delegates for other objects (including asynchronous methods that might still be running).

My questions are :

  • What are the rules for a UIViewController to receive a didReceiveMemoryWarning message ? Why don’t my former detail view controllers receive them ?
  • Can I safely call didReceiveMemoryWarning or viewDidUnload myself on these old view controllers ?
  • 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-27T04:45:11+00:00Added an answer on May 27, 2026 at 4:45 am

    It looks like a UIViewController subscribes to UIApplicationDidReceiveMemoryWarningNotification when it is created. It removes observing the notification when it is deallocated. So didReceiveMemoryWarning is called even if the the controller’s view is not in the view hierarchy. So make sure your controllers are not deallocated.

    It is unlikely but if you happen to be using the following code to remove notification observation from your controllers they will also stop listening memory notifications.

    [[NSNotificationCenter defaultCenter] removeObserver:controller name:nil object:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPad app. In the Root View I have a UITableView with
I'm trying to set up a Tab Bar Application as my root controller, and
Currently I have a root-level repository set up for each project, like so: Project1
config.php put at the root level, this file will be included in any pages.
I have two processes - a user process and a root-level LaunchDaemon. I'd like
The file at xsltFileName is in my project WebSite2 (at the root-level of the
I am getting this error: Data at the root level is invalid. Line 1,
I have a table of categories. Each category can either be a root level
With a JTree, assuming the root node is level 0 and there may be
I have a page that sites in a first level folder from my root

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.