Re: stringByReplacingCharactersInRange leading to bus error
Re: stringByReplacingCharactersInRange leading to bus error
- Subject: Re: stringByReplacingCharactersInRange leading to bus error
- From: Murat Konar <email@hidden>
- Date: Wed, 18 Aug 2010 12:15:06 -0700
Yes, sorry. The problem I had wasn't a memory management problem. I
had to do with a custom NSFormatter breaking proper KVO notification
because -stringByReplacingCharactersInString: was returning self when
no substitution occurred.
Bug ID 7775697, in case anyone cares.
_murat
On Aug 18, 2010, at 11:56 AM, Dave Carrigan wrote:
On Aug 18, 2010, at 11:52 AM, Murat Konar wrote:
On Aug 18, 2010, at 11:06 AM, John C. Randolph wrote:
-stringByReplacingCharactersInString: creates and returns a new
string, which is autoreleased.
Always? I recall running into a problem that was caused by -
stringByReplacingCharactersInString: (or a method like it) simply
returning self if no substitution occurred.
The memory management rules says it returns a string that you don't
own. If you need it to exist in the future, you have to retain it.
Its implementation details are irrelevant (to you).
--
Dave Carrigan
email@hidden
Seattle, WA, USA
_______________________________________________
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