• 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: Autorelease question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Autorelease question


  • Subject: Re: Autorelease question
  • From: Rohan Lloyd <email@hidden>
  • Date: Fri, 4 Apr 2008 13:45:56 +1100


On 4 Apr 2008, at 1:32 PM, Chris Suter wrote:

On 04/04/2008, at 1:25 PM, Dmitry Markman wrote:

how can you explain that
NSString *nsFontName = [NSString stringWithCString:fontName encoding:NSMacOSRomanStringEncoding];
can be released, but
NSString *textString = [NSString stringWithCString:"Hello From Cocoa" encoding:NSMacOSRomanStringEncoding];
can not
so what's the difference?

Neither of them should be released; there's no difference.

Nobody wants to answer memory management questions on this list, not least because it's better said in the documentation. It's very comprehensively covered in the documentation so please take the time to read and understand them.

There was a previous thread that talked about this issue with the subject "Garbage collection - was Beginner with Cocoa". I'd suggest you read through that too. It starts here:


  http://lists.apple.com/archives/cocoa-dev/2008/Mar/msg01922.html

That thread gives a few good links to Apple's documentation on the subject. I'll provide the links here to make it easy:

  http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_5.html
  http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html
  http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmPractical.html
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Autorelease question (From: Dmitry Markman <email@hidden>)
 >Re: Autorelease question (From: Robert Claeson <email@hidden>)
 >Re: Autorelease question (From: Jens Alfke <email@hidden>)
 >Re: Autorelease question (From: Dmitry Markman <email@hidden>)
 >Re: Autorelease question (From: Dmitry Markman <email@hidden>)
 >Re: Autorelease question (From: Rob Keniger <email@hidden>)
 >Re: Autorelease question (From: Dmitry Markman <email@hidden>)
 >Re: Autorelease question (From: Chris Suter <email@hidden>)

  • Prev by Date: Re: Autorelease question
  • Next by Date: Re: Autorelease question
  • Previous by thread: Re: Autorelease question
  • Next by thread: Re: Autorelease question
  • Index(es):
    • Date
    • Thread