Re: Memory management question
Re: Memory management question
- Subject: Re: Memory management question
- From: Kevin Ballard <email@hidden>
- Date: Wed, 24 Mar 2004 15:06:22 -0500
You do realize that what you're doing is creating a new object, then
using it to modify the current object? So you're not cutting down on
your object usage at all, but in fact you are making it slightly slower
(since instead of just replacing the object you're modifying it). This
also requires your string to be mutable.
On Mar 24, 2004, at 1:43 PM, Randall Meadows wrote:
>
At 12:40 PM -0500 3/24/04, Randall Meadows wrote:
>
>
> line = [line stringByTrimmingCharactersInSet:...];
>
>
I now notice that NSMutableString has setString: available. Would it
>
be more efficient to do
>
>
[[line setString:[line stringByTrimmingCharactersInSet:...];
>
>
instead of creating a new object each time? That should trim down the
>
number of objects in my autorelease pool, right (which, at times, can
>
be a lot, which is why I'm using a number of nested autorelease
>
pools)?
--
Kevin Ballard
email@hidden
http://www.tildesoft.com
http://kevin.sb.org
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.