• 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: NSEnumerator retaining objects?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSEnumerator retaining objects?


  • Subject: Re: NSEnumerator retaining objects?
  • From: Marco Scheurer <email@hidden>
  • Date: Wed, 9 Mar 2005 18:57:15 +0100


On Mar 09, 2005, at 17:17PM, j o a r wrote:

I don't think that Marco commented on the use of reference counting for memory management in general.

That's right. I'm perfectly happy with the reference counting mechanism of Cocoa. But there is a school that says that every accessors should return retained and autoreleased accessors:


- (NSString *) title
{
	return [[title retain] autorelease];
}

instead of:

- (NSString *) title
{
	return title;
}

Note that this is not necessarily what NSArray's enumerator does: I don't know how it is implemented. It was not my intention to reignite that debate, a look in the archives should give you all the arguments.

marco


Marco Scheurer Sen:te, Lausanne, Switzerland http://www.sente.ch

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSEnumerator retaining objects?
      • From: Shaun Wexler <email@hidden>
References: 
 >Re: NSEnumerator retaining objects? (From: James Bucanek <email@hidden>)
 >Re: NSEnumerator retaining objects? (From: mmalcolm crawford <email@hidden>)
 >Re: NSEnumerator retaining objects? (From: Shaun Wexler <email@hidden>)
 >Re: NSEnumerator retaining objects? (From: j o a r <email@hidden>)
 >Re: NSEnumerator retaining objects? (From: Shaun Wexler <email@hidden>)
 >Re: NSEnumerator retaining objects? (From: j o a r <email@hidden>)
 >Re: NSEnumerator retaining objects? (From: Marco Scheurer <email@hidden>)
 >Re: NSEnumerator retaining objects? (From: "Geert B. Clemmensen" <email@hidden>)
 >Re: NSEnumerator retaining objects? (From: j o a r <email@hidden>)

  • Prev by Date: Re: objective-c / cocoa efficiency
  • Next by Date: Re: WebKit not there
  • Previous by thread: Re: NSEnumerator retaining objects?
  • Next by thread: Re: NSEnumerator retaining objects?
  • Index(es):
    • Date
    • Thread