Re: Retain/release objects in an array...
Re: Retain/release objects in an array...
- Subject: Re: Retain/release objects in an array...
- From: Marcel Weiher <email@hidden>
- Date: Thu, 25 Jul 2002 10:15:34 +0200
On Wednesday, July 24, 2002, at 02:41 Uhr, Ondra Cada wrote:
On Wednesday, July 24, 2002, at 07:27 , Jiva DeVoe wrote:
I'm unclear... If I return an objectEnumerator from an array in one
of my
functions... Should I autorelease it before returning it?
Nope. It is autoreleased already.
It may or may not be autoreleased. It just isn't your responsibility to
clean it up (but conversely your responsibility to -retain if you want
to keep it).
[..]
Also, if I get an object via objectAtIndex, should I retain that as
well?
Again, use the generic retain/release rules.
Very good advice! Don't count on things *being* autoreleased or not.
Free your mind from such mind-numbing details! :-) Just remember when
something is your problem, and when it is SEP (Somebody Else's Problem).
Marcel
--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
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.