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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:04:05+00:00 2026-06-04T19:04:05+00:00

With ARC enabled I have a property @property (strong, nonatomic) NSMutableArray *arr; I Allocate

  • 0

With ARC enabled I have a property

  @property (strong, nonatomic) NSMutableArray *arr;

I Allocate it as

  self.arr = [NSMutableArray array];

I have a custom object ERSearchView, I allocate it and add it to the arr

  ERSearchView *SV = [[ERSearchView alloc] initWithDelegate:nil];
  [arr addObject:SV];

In my search view I have overridden the dealloc method, because it seems that the search view isn’t getting released:

- (void)dealloc {
  self.delegate = nil;
  NSLog(@"deallocated search view");
}

This isn’t getting called when I pop my view controller. But if I nil the arr variable in the view controller’s dealloc I see the log message that the search view has been deleted.

Can anyone explain how is this possible that objects inside arr aren’t getting released though the view controller is 100% released since I have “did dealloc” message in its dealloc?

  • 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-04T19:04:06+00:00Added an answer on June 4, 2026 at 7:04 pm

    Foundation collection classes such as NSArray, NSDictionary, etc. retain (or have a strong reference to, in ARC-speak) the objects they contain. So as long as the array hasn’t been deallocated, the objects it refers to, including your view instance, should still be in memory.

    It sounds as though you were leaking the array previously by not setting the property to nil in the controller’s dealloc method. When an object declares a property as strong, it’s responsible for the nilling the reference in its dealloc implementation to avoid this kind of leak.

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

Sidebar

Related Questions

I have ARC enabled and I'm trying to do: CGColorRef outerColor = (id)[UIColor colorWithWhite:1.0
In my iOS ARC-enabled code, I need to pass self and other objects to
In a ARC enabled project, is there a way to add the -fno-objc-arc tag
In a doc-based ARC-enabled application I have a WebView that is opening an HTML
I have the following code, which is causing a leak, despite ARC being enabled
I have an ARC-enabled project using RestKit and although most of my requests are
Why do I have a memory leaking with ARC enabled(highlighted in bold)? I have
Is it possible to have an iOS app that's not ARC enabled but with
I need to generate a UUID string in some code with ARC enabled. After
I'm getting a strange exception in Xcode 4.2.1 (ARC-enabled project) that I can't track

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.