Re: stringByReplacingCharactersInRange leading to bus error
Re: stringByReplacingCharactersInRange leading to bus error
- Subject: Re: stringByReplacingCharactersInRange leading to bus error
- From: Sherm Pendley <email@hidden>
- Date: Wed, 18 Aug 2010 15:16:48 -0400
On Wed, Aug 18, 2010 at 2:52 PM, Murat Konar <email@hidden> wrote:
>
> On Aug 18, 2010, at 11:06 AM, John C. Randolph wrote:
>
>> -stringByReplacingCharactersInString: creates and returns a new string,
>> which is autoreleased.
>
> Always?
Yes, always.
> I recall running into a problem that was caused by
> -stringByReplacingCharactersInString: (or a method like it) simply returning
> self if no substitution occurred.
Possibly, but even in that case it would still have to "return [[self
retain] autorelease];" in order to fulfill its end of the memory
management contract.
sherm--
--
Cocoa programming in Perl:
http://camelbones.sourceforge.net
_______________________________________________
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