Re: Questions about retain
Re: Questions about retain
- Subject: Re: Questions about retain
- From: Ted Lowery <email@hidden>
- Date: Fri, 27 Dec 2002 14:54:39 -0500
Is this better? Anything leaking here? Body is created by
body = [[NSMutableString alloc] init];
in the objects - (id)init method and released
[body release];
in - (void)dealloc.
[body appendFormat:@"<area shape=%cRECT%c coords=%c", 34, 34, 34];
[body appendFormat:@"%0.0f, %0.0f, %0.0f, %0.0f",
r.origin.x, r.origin.y, r.size.width, r.size.height];
[body appendFormat:@"%c href=%clinkhere%c>\n", 34, 34, 34];
NSMutableString* s = [[NSMutableString alloc] init];
[s appendString:header];
[s appendString:body];
[s appendString:footer];
[textView setString:s];
[s release];
Thanks, Ted
On Friday, December 27, 2002, at 02:18 PM, Sherm Pendley wrote:
>
On Friday, December 27, 2002, at 01:12 PM, Ted Lowery wrote:
>
>
> body = [body stringByAppendingString:coords];
>
>
This line creates a new autoreleased string by appending the coords
>
string to the existing body string. The new string is assigned to
>
body, and the old body string is leaked.
_______________________________________________
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.