Re: real authority on what needs to be released
Re: real authority on what needs to be released
- Subject: Re: real authority on what needs to be released
- From: Dean Davis <email@hidden>
- Date: Wed, 11 Sep 2002 10:20:28 -0700 (PDT)
--- James DiPalma <email@hidden>
wrote:
>
A bunch of stuff of how I'm a bone-head.
Well, contrary to what maybe popular belief I knew
going into this that objects created using alloc or
"copy" methods need to be explicitly released and all
others do not as they will be autoreleased (in
general).
Here is a piece of code in a method
HTMLData = [HTMLData stringFromIndex:40];
The original instance of HTMLData was not created
using alloc or a copy method, it was not retained yet
the objects pile up upon one another way way up into
the sky as the method is called repeatedly by a timer.
So, as far as I know it is not strieght forward.
I have an example program that leaks. Has anyone even
botherd to look at it? Now in the example that is
available for anyone to look at I do use "copy" to
create an NSString so I understand that I would need
to release it. But, that isn't the focus of my leak
question and also by changing that line to...
HTMLData = [NSString stringWithString:myString];
it still does not release and I did not use alloc or
copy to create the string.
It doesn't release.
Your simple rule seems to be wrong in some case. At
least that is what I have to assume until someone can
look at the code and tell me where I went wrong.
My point, from my perspective I have objects hanging
around that were not created using alloc or copy and
no one can tell me why if anyone can at all. Not any
book or on line resource or any of the eight things
you suggested I read.
Dean Davis
__________________________________________________
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.