• 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: Michael Grant <email@hidden>
  • Date: Thu, 12 Jul 2001 09:11:48 -0500

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];

I'm quite sure the instructions to do so eat a lot more bytes than the empty constant. Further, this needs some processor cycles while the constant does not.

Even for non-empty constants there isn't much to win unless you store the contents in a (load-on-demand) resource file.


On the third hand, doesn't using string constants within your code create potential difficulties in localization? This may not be an issue for everyone, but if you ever want to market your software abroad....

three-handed Michael

--
BLUE DANUBE international communication services
The Central and East European Language Source!
<http://www.bdanube.com>, <mailto:email@hidden>
Tel. (+1-512) 336-8911, Fax (+1-512) 336-8954


  • Follow-Ups:
    • Re: Status of @"" strings
      • From: Stéphane Sudre <email@hidden>
References: 
 >Re: Status of @"" strings (From: Markus Hitter <email@hidden>)

  • Prev by Date: Re: NSThread question - DO to make it sing
  • Next by Date: Re: NSBezierPath, Accessing elements of a NSBezierPath path
  • Previous by thread: Re: Status of @"" strings
  • Next by thread: Re: Status of @"" strings
  • Index(es):
    • Date
    • Thread