• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Questions about retain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Questions about retain
      • From: Sherm Pendley <email@hidden>
References: 
 >Re: Questions about retain (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Using NSCell to bold cells in a tableview
  • Next by Date: Re: Crontab/Scheduled tasks
  • Previous by thread: Using NSCell to bold cells in a tableview
  • Next by thread: Re: Questions about retain
  • Index(es):
    • Date
    • Thread