Memory and stringByAppendingString
Memory and stringByAppendingString
- Subject: Memory and stringByAppendingString
- From: Aidas Dailide <email@hidden>
- Date: Sun, 18 May 2003 22:56:25 +0300
Hi,
I have a question about memory management. I still can't master it. I
just can't fully understand what to do on some case. Here is one of
them:
NSString* finalH=[[[[NSString alloc] initWithString:@""] autorelease]
retain];
for (i=0;i<[array count];i++)
{
finalH=[finalH stringByAppendingString:[self
hyphenateString:[array objectAtIndex:i]]];
finalH=[finalH stringByAppendingString:@" "];
}
Can you believe that this code can take about 100 Mb (ofcourse you
can)!! Could anyone explain me (and write some example code) on how to
fix this?
Thanks,
Newbie Aidas
_______________________________________________
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.