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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:05:13+00:00 2026-06-07T13:05:13+00:00

I converted my app to ARC and noticed that an object alloc’ed in one

  • 0

I converted my app to ARC and noticed that an object alloc’ed in one of my view controllers was not being dealloc’ed when that view controller was dealloc’ed. It took a while to figure out why. I have Enable Zombie Objects on for my project while debugging and this turned out to be the cause. Consider the following app logic:

1) Users invokes action in RootViewController that causes a SecondaryViewController to be created and presented via presentModalViewController:animated.

2) SecondaryViewController contains an ActionsController that is an NSObject subclass.

3) ActionsController observes a notification via NSNotificationCenter when it is initialized and stops observing when it is dealloc’ed.

4) User dismisses SecondaryViewController to return to RootViewController.

With Enable Zombie Objects turned off, the above works fine, all objects are deallocated. With Enable Zombie Objects on ActionsController is not deallocated even though SecondaryViewController is deallocated.

This caused problems in my app b/c NSNotificationCenter continues to send notifications to ActionsController and the resulting handlers cause the app to crash.

I created a simple app illustrating this at https://github.com/xjones/XJARCTestApp. Look at the console log with Enable Zombie Objects on/off to verify this.

QUESTION(S)

  1. Is this correct behavior of Enable Zombie Objects?
  2. How should I implement this type of logic to eliminate the issue. I would like to continue using Enable Zombie Objects.

EDIT #1: per Kevin’s suggestion I’ve submitted this to Apple and openradar at http://openradar.appspot.com/10537635.

EDIT #2: clarification on a good answer

First, I’m an experienced iOS developer and I fully understand ARC, zombie objects, etc. If I’m missing something, of course, I appreciate any illumination.

Second, it is true that a workaround for this specific crash is to remove actionsController as an observer when secondaryViewController is deallocated. I have also found that if I explicitly set actionsController = nil when secondaryViewController is dealloc’ed it will be dealloc’ed. Both of these are not great workaround b/c they effectively require you to use ARC but code as if you are not using ARC (e.g. nil iVars explicitly in dealloc). A specific solution also doesn’t help identify when this would be an issue in other controllers so developers know deterministically when/how to workaround this issue.

A good answer would explain how to deterministically know that you need to do something special wrt an object when using ARC + NSZombieEnabled so it would solve this specific example and also apply generally to a project as a whole w/o leaving the potential for other similar problems.

It is entirely possible that a good answer doesn’t exist as this may be a bug in XCode.

thanks all!

  • 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-07T13:05:15+00:00Added an answer on June 7, 2026 at 1:05 pm

    Turns out it is an iOS bug. Apple has contacted me and indicated they’ve fixed this in iOS 6.

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

Sidebar

Related Questions

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:355:in `to_plist': An object in the argument tree could not be converted (ArgumentError) from
i have just converted an app i was making from a navigation controller app
I have my ipad code created programmatically not using nib.I converted my ipad app
I'm porting a app to FreePasal/Lazarus & found that their form converter is not
I converted my app to ARC and removed all the pre-build release errors. It
OK i have a web page that i converted to an App. Its a
I just converted my app to ARC , and while it builds fine, I
I converted a standalone Flex app into a module. Now that it's a module,
Im trying to start a wxPython app that (I have converted to an exe
Our company uses an app that was originally ColdFusion + Access later converted to

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.