• 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: Status of @"" strings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Status of @"" strings


  • Subject: Re: Status of @"" strings
  • From: Art Isbell <email@hidden>
  • Date: Wed, 11 Jul 2001 21:56:29 -1000

On Wednesday, July 11, 2001, at 09:27 PM, Rob Rix wrote:

What is the status of strings in your code that have been created using the @"" shorthand? It's shorthand for creating an NSString instance, yes (I seem to recall reading that, and also I seem to recall sample code somewhere that had an @"" string as the receiver of a message)? Is it autoreleased?

These are uniqued string constants, probably similar to C string constants (someone more familiar than I with string constants please correct me). These string constants are allocated in unmodifiable memory such that every reference to the same string constant will refer to the same memory location. So don't try to modify them - they're immutable.

Because they are string constants, they will not be freed during the life of the process, so they needn't be retained or released.

Art Isbell
Apple iServices Technical Support
http://www.apple.com/iservices/webobjectssupport/
+1-808-591-0836


  • Follow-Ups:
    • Re: Status of @"" strings
      • From: Chris Kane <email@hidden>
References: 
 >Status of @"" strings (From: Rob Rix <email@hidden>)

  • Prev by Date: Re: NSBezierPath and draw NSString in NSView.
  • Next by Date: Re: NSThread question - DO to make it sing
  • Previous by thread: Status of @"" strings
  • Next by thread: Re: Status of @"" strings
  • Index(es):
    • Date
    • Thread