Re: Status of @"" strings
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