• 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: Bill Cheeseman <email@hidden>
  • Date: Thu, 12 Jul 2001 07:55:19 -0400

on 7/12/01 3:58 AM, Andreas Monitzer at email@hidden wrote:

> On Thursday, July 12, 2001, at 09:27 , Rob Rix wrote:
>
>> This has been bothering me for a while now...
>>
>> 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?
>
> No, @"" doesn't create an instance, just like "" doesn't allocate memory.
> Both are stored in the code part of the app, so they're loaded when the
> code loads and free'd when the code is removed from memory. retain,
> release and autorelease is ignored by @"".

So, if you want to have a temporary empty string that you CAN release so
that it won't hang around in the code for the life of the app, is this
preferred? --

NSString *emptyString = [[NSString alloc] init];

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA

The AppleScript Sourcebook - www.AppleScriptSourcebook.com
Vermont Recipes - www.stepwise.com/Articles/VermontRecipes


  • Follow-Ups:
    • Re: Status of @"" strings
      • From: Ali Ozer <email@hidden>
    • Re: Status of @"" strings
      • From: Markus Hitter <email@hidden>
References: 
 >Re: Status of @"" strings (From: Andreas Monitzer <email@hidden>)

  • Prev by Date: Re: Singleton instances and multithreading
  • Next by Date: Re: Bug in Security Framework?
  • Previous by thread: Re: Status of @"" strings
  • Next by thread: Re: Status of @"" strings
  • Index(es):
    • Date
    • Thread