Re: Help: How do you start debugging this crashlog?
Re: Help: How do you start debugging this crashlog?
- Subject: Re: Help: How do you start debugging this crashlog?
- From: "Alastair J.Houghton" <email@hidden>
- Date: Sun, 20 Jul 2003 23:23:01 +0100
On Sunday, July 20, 2003, at 10:59 pm, Steven M.Palm wrote:
On Sunday, July 20, 2003, at 01:45 AM, p3consulting wrote:
You have allocated an autoreleased object you forget to retain in one
of your init/awakeFromNib or class initialization routines that is
called very early in your program:
I don't know if I'll *EVER* get this stuff, and it's supposed to be
pretty simple. ;-)
It is. People think about it too much and confuse themselves.
I thought that things I allocated via [[object alloc] init] were my
responsibility to release, that I didn't have to specifically give
them a retain message.
Apparently I think wrong... Back to the books.
No, you think right. You only need to release or autorelease when you
have allocated, copied or retained an object. If you obtain an object
from any method that does not contain the words "alloc" or "copy" in
its name, then that object has already been autoreleased and does not
need to be released again unless you retain it. Conversely, an object
obtained from such a method needs to be retained if you expect it to
persist outside of the current event (i.e. you should regard it as
destroyed the moment the processor returns to the framework).
Kind regards,
Alastair.
_______________________________________________
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.