• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: “EXC_BAD_ACCESS” object is not nil but not accessible
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: “EXC_BAD_ACCESS” object is not nil but not accessible


  • Subject: Re: “EXC_BAD_ACCESS” object is not nil but not accessible
  • From: Marco Frisan <email@hidden>
  • Date: Mon, 17 Jan 2011 01:48:08 +0100

Il giorno 16/gen/2011, alle ore 19.06, Kyle Sluder ha scritto:

> On Jan 15, 2011, at 3:55 AM, Marco Frisan <email@hidden> wrote:
>
>> I don't understand why _record.attributes causes a “EXC_BAD_ACCESS” signal.
>
> This is the defining characteristic of a memory management bug: you have a pointer to an object that has since been freed. Trying to use that pointer is an error.
>
> --Kyle Sluder


Yes I know that. The problem is that I am was not able to find which pointer. And the reason I am not able to find it is that the line that cause the application block is:

NSDictionary * attributes = _record.attributes;

inside the numberOfRowsInTableView: method of my custom class VLVolumeDetailsViewController.

I checked with debugger and _record, that points to a VLDiskItemRecord object, is not nil.
attributes should be not nil too and are retained by the object pointed by _record when they are initialized.

Though it seems that I resolved it using initWithDictionary:copyItems: and passing YES as its second parameter, to create a copy of the attributes dictionary, instead of simply retain the one returned by attributesOfItemAtPath:error:. Though I do not understand yet which was the object freed in the previous approach.

--Marco Frisan
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: “EXC_BAD_ACCESS” object is not nil but not accessible
      • From: Kyle Sluder <email@hidden>
References: 
 >“EXC_BAD_ACCESS” object is not nil but not accessible (From: Marco Frisan <email@hidden>)
 >Re: “EXC_BAD_ACCESS” object is not nil but not accessible (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Parental Controls altering binary
  • Next by Date: Re: Get iphoto scripting bridge handle without starting iphoto?
  • Previous by thread: Re: “EXC_BAD_ACCESS” object is not nil but not accessible
  • Next by thread: Re: “EXC_BAD_ACCESS” object is not nil but not accessible
  • Index(es):
    • Date
    • Thread