• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Retain/release objects in an array...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Retain/release objects in an array... (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: What is the purpose of static typing?
  • Next by Date: Re: (got it) lower-right origin on NSView?
  • Previous by thread: Re: Retain/release objects in an array...
  • Next by thread: Re: Retain/release objects in an array...
  • Index(es):
    • Date
    • Thread