• 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: [newbie] NSString code so it won't leak, again
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [newbie] NSString code so it won't leak, again


  • Subject: Re: [newbie] NSString code so it won't leak, again
  • From: Jeff LaMarche <email@hidden>
  • Date: Tue, 10 Sep 2002 07:43:57 -0700 (PDT)

Hmmm...

Here's my take, although someone more experienced can (and certainly will =) ) correct me if I'm wrong: I don't think your first version is actually leaking. I'm assuming from your first code sample that you're using an NSString constant in Cocoa just as you did with your first pseudo-code example (NSString *myString = @"REALLY LONG...STRING";) Here's what the docs say about NSString constants (@"xxx"):

"Such an object is created at compile time and exists throughout your program's execution. The compiler makes such object constants unique on a per-module basis, and they're never deallocated (though you can retain and release them as you do any other object)."

Therefore, it's going to hang around no matter what you do... it's never deallocated even if you release it, so don't worry about fixing it...

Jeff
_______________________________________________
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.

  • Prev by Date: iCal is available!
  • Next by Date: Re: [newbie] NSString code so it won't leak, again
  • Previous by thread: Re: [newbie] NSString code so it won't leak, again
  • Next by thread: Re: [newbie] NSString code so it won't leak, again
  • Index(es):
    • Date
    • Thread