Re: NSCell, copying, and objectValue
Re: NSCell, copying, and objectValue
- Subject: Re: NSCell, copying, and objectValue
- From: Matt Neuburg <email@hidden>
- Date: Fri, 03 Nov 2006 10:27:31 -0800
- Thread-topic: NSCell, copying, and objectValue
On Fri, 3 Nov 2006 05:08:37 -0800, "Ken Ferry" <email@hidden> said:
>On 11/2/06, Matt Neuburg <email@hidden> wrote:
>>
>> Is there something funny about how NSCell's setObjectValue works?
>> Something
>> odd about how it copies and/or retains?
>Like everyone says, paying attention to retainCount is usually not useful.
>Try Object Alloc. It can keep a backtrace for every retain, release and
>autorelease message sent in your app. Look for something that isn't
>balanced.
Yes, and I'm one of the people who keeps saying don't pay attention to
retainCount and use ObjectAlloc instead! However, you're right to hold up
the mirror on this. :)
In the end I think I've learned two things:
(1) NSCell was probably a red herring. I think the problem comes from a
memory management bug having to do with how ObjectiveC and AppleScript
communicate in a hybrid AppleScript Studio app.
(2) I figured that out, in just the way you said, namely by using
ObjectAlloc - but goodness what a crummy interface it has! It doesn't even
add up the retain / release messages and give you a total, let alone help
you work out the balance between them. (And you can barely even make out the
difference between the words "release" and "retain" in that tiny type it
uses.) I had to use a pen and several pieces of paper and make a huge
complicated chart.
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden