Re: Status of @"" strings
Re: Status of @"" strings
- Subject: Re: Status of @"" strings
- From: Stéphane Sudre <email@hidden>
- Date: Thu, 12 Jul 2001 16:53:44 +0200
On jeudi, juillet 12, 2001, at 04:11 PM, Michael Grant wrote:
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....
Since you need to specify a string constant for the NSLocalizedString
family of functions...