• 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: 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.

  • Follow-Ups:
    • Re: Questions about retain
      • From: Ted Lowery <email@hidden>
    • Using NSCell to bold cells in a tableview
      • From: Ben Mackin <email@hidden>
References: 
 >Questions about retain (From: Ted Lowery <email@hidden>)

  • Prev by Date: Re: problem with NSFileHandle's readDataToEndOfFile
  • Next by Date: Child, parent and key windows
  • Previous by thread: Questions about retain
  • Next by thread: Using NSCell to bold cells in a tableview
  • Index(es):
    • Date
    • Thread