On Aug 18, 2010, at 2:23 PM, Kyle Sluder wrote: > On Wed, Aug 18, 2010 at 2:08 PM, Sherm Pendley <sherm.pend...@gmail.com> > wrote: >> Indeed, on that very page, at >> <http://developer.apple.com/mac/library/documentation/cocoa/conceptual/MemoryMgmt/Articles/mmAccessorMethods.html#//apple_ref/doc/uid/TP40003539-SW6>, >> it gives this example: > > It gives it as one example of three, the other two not having > performing an immediate retain/autorelease pair.
Omitting retain/autorelease from a getter is acceptable, though generally discouraged nowadays. Omitting retain/autorelease from a convenience constructor like -stringByReplacingOccurrencesOfString: is not. A convenience constructor must always act as if the result is autoreleased. -- Greg Parker gpar...@apple.com Runtime Wrangler _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com