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

  • Home
  • SEARCH
  • 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 8678217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:39:33+00:00 2026-06-12T20:39:33+00:00

When I release a UIViewController, the UIViewController is correctly destroyed but its dealloc method

  • 0

When I release a UIViewController, the UIViewController is correctly destroyed but its dealloc method is not called.

If the UIViewController has been destroyed (it is nil in the console), then the retain count should be 0, consequently I expect the -(void)dealloc method to be called.

I’ve also checked for subclasses of my UIViewController, overriding dealloc without calling the superclass method, but this is not the case.

This is how I initialize it:

myViewController = [[MyViewController alloc] initWithViewController:statusPicker];

What could be the reason ?
Thanks

  • 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-12T20:39:34+00:00Added an answer on June 12, 2026 at 8:39 pm

    If the UIViewController has been destroyed (it is nil in the console),
    then the retain count should be 0, consequently I expect the
    -(void)dealloc method to be called.

    Well, no. The fact of being nil, doesn’t mean the UIViewController has been released. Put it simple, the pointer for the UIViewController, is now pointing to nil, but the memory where the UIViewController reside is still being occupied. Instead of being called dealloc, two things might be happening:

    1) There is something else with a reference to the UIViewController (example: when you pushViewController B from A, A got a reference to B).

    2) You got a memory leak.

    Again I am basing my answer in what you said:

    @Lefteris Automatic Referencing Counting = NO

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

Sidebar

Related Questions

I have a UIViewController that should lazily load a view and then keep it
Can anyone verify my dealloc method is correct? Since my titleLabel and checkImageView are
The code: UIViewController *viewController = [[UIViewController alloc] initWithNibName:@NibName bundle:nil]; UINavigationController *navigationController = [[UINavigationController alloc]
I have a UIViewController that has a UIPickerView and UITableView. The UIPicker has 3
I have a UIViewController class, which has a button which triggers this: DetailViewController *viewController
I need help trying to configure in a UIViewController, the keyboard : (a) not
I have a UIViewController with this method: -(void)prepareToShowVault { ... UINavigationController *passcodeNavigationController = [[UINavigationController
I have UINavigation Controller that has a UIViewController pushed onto the stack and displayed.
I know that similar questions have been asked before. But I've been searching SO
I have two uiviewcontroller and i am releasing all the resources in dealloc and

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.