Re: stringByReplacingCharactersInRange leading to bus error
Re: stringByReplacingCharactersInRange leading to bus error
- Subject: Re: stringByReplacingCharactersInRange leading to bus error
- From: Greg Parker <email@hidden>
- Date: Wed, 18 Aug 2010 14:27:22 -0700
On Aug 18, 2010, at 2:23 PM, Kyle Sluder wrote:
> On Wed, Aug 18, 2010 at 2:08 PM, Sherm Pendley <email@hidden> 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 email@hidden Runtime Wrangler
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden