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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:08:50+00:00 2026-06-15T05:08:50+00:00

In an iOS 6 app I have some view controllers that are added as

  • 0

In an iOS 6 app I have some view controllers that are added as observers with the default notification center. They are added in the viewDidLoad method because I want the controllers to receive the notifications even when they are not on top.

A lot of people recommend removing the observer in the dealloc method. However, I have been logging messages with NSLog() both when adding and removing the observer, and it looks like dealloc is never called (I am using ARC).

Contrary to what one would think, the viewDidUnload method is not an option, since in iOS 5 it was only called during low-memory conditions, and in iOS 6 it is not called at all.

It actually seems that there is no way to do what the documentation requires! So far, my application has not crashed, by the way, even though controllers are being added multiple times and (apparently) never removed.

Note: So far I have been testing with the simulator only; is it possible that dealloc does get called in an actual device, but not in the simulator? Or is the call to NSLog() just not showing up (it shows up everywhere else, though).

  • 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-15T05:08:51+00:00Added an answer on June 15, 2026 at 5:08 am

    Even in arc, dealloc is called. You cannot call [super dealloc] in arc but dealloc should be called if your view controller is being released. But, if you find it really difficult to manage, the situation why dont you add the notification observer in viewWillAppear and then remove it in viewWillDisappear. That way you will get notification until the view is shown and while the view is not shown, it may be released so it does not bother much to remove observer in viewWillDisappear. But, surely enough dealloc is called and is a good place for this.

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

Sidebar

Related Questions

In my app, I have many different functions. These are view controllers that are
In my iOS app I have several UIElement s that can process user input:
I have an iOS app that uses a number of enums for valid values,
I have an iOS app with a UITableView that has flexible width, which allow
I have an old iOS app that I never distributed and am now trying
I have an iOS app I created as a view-based app in xCode. I
I have an app that runs on iPad and iPhone running iOS 3.2, but
I have created a Universal app using Interface Builder. My view controllers are embedded
On first view that is displayed to the user, I have to populate some
I have an iOS app working and am trying to clean up some of

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.