Re: More memory allocation questions
Re: More memory allocation questions
- Subject: Re: More memory allocation questions
- From: Shawn Erickson <email@hidden>
- Date: Sun, 28 Jul 2002 15:03:24 -0700
On Sunday, July 28, 2002, at 01:43 PM, Marcel Weiher wrote:
If you don't alloc/init an object, you shouldn't release it.
If you don't: +alloc, -copy, -retain an object. -init doesn't play a
part.
small nit...
-init can play a part if it happens to internally allocate a different
object (or retaining a shared object) and returns that to you instead
of the object you +alloc(ed). If -init does this it will make sure to
release the one you allocated before it returns.
With that said you really don't call init yourself without also calling
alloc ([[SomeClass alloc] init]).
-Shawn
_______________________________________________
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.