Re: Questions about retain
Re: Questions about retain
- Subject: Re: Questions about retain
- From: Sherm Pendley <email@hidden>
- Date: Fri, 27 Dec 2002 14:18:39 -0500
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.
From your description, It sounds like what you really intended to do
here is not create a new string, but append coords to the existing body
string. To do that, body will need to be an NSMutableString, and you'll
need to append coords like this:
[body appendString: coords];
sherm--
If you listen to a UNIX shell, can you hear the C?
_______________________________________________
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.