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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:31:47+00:00 2026-05-25T21:31:47+00:00

I’ve a tableviewcontroller which stores dictionary objects in an Array, when a row gets

  • 0

I’ve a tableviewcontroller which stores dictionary objects in an Array, when a row gets selected I push a new view controller on the navigation stack and I pass a dictionary object from the array in it’s initializer, the dictionary object will be retained in a property of the new view controller. When I return back to my tableviewcontroller I release the dictionary object in the dealloc of the view controller. But when I scroll down/back in my tableviewcontroller, the dictionary that was passed to the view controller is deallocated in the tableviewcontroller’s Array and the program crashes with the message:

BreakdanceSource[1351:607] * Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key title.’

When I remove the [dictionary release] from the dealloc function of the view controller, the program works and doesn’t crash! It’s weird because I thought the array also keeps ownership of it’s objects so the dictionary shouldn’t have been deallocated.

Why can’t I release the dictionary object in my view controller? (I’ve removed the [dictionary release] now in the dealloc and the program works but won’t I have a memory leak? )

I’ve tried this so far!:

imageshack.us/photo/my-images/813/screenshot20110926at610.png I’ve used the zombies tool and this is my result! What I don’t get is that before the dealloc of my view controller the retain count is 1 which should’ve been 2. Because the array in the tableviewcontroller should own the dictionary and I’ve a property in my view controller which is @property (retain) NSDictionary* media. I don’t know where my dictionary gets released, because now it only gets released in the view controller’s dealloc

I’ve also tried to change the property @property (retain) to @property NSDictionary* media then I use media = [infoDictionary retain] and it doesn’t crash.. did my property (retain) not retain it?

  • 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-25T21:31:48+00:00Added an answer on May 25, 2026 at 9:31 pm

    Yes NSMutableArray increases the retain count of an object that is added to it and correspondingly decreases the retain count when the NSMutableArray is released. That does not stop something else from decrementing the retain count to the point of an objects release. So, there must be another release/autorelease of the object.

    Use Instruments Allocation tool, set the retain count option, find the object and you will see where the extra release is happening. See this SO answer for info on using Instruments in this manner.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.