FROM : Jim Correia
DATE : Sat Jun 28 20:09:11 2008
On Jun 26, 2008, at 8:32 PM, Nick Zitzmann wrote:
> On Jun 26, 2008, at 6:16 PM, William Squires wrote:
>
>> Actually, "if ([myString length] == 0)" is probably better, but
>> just IMHO... :)
>
> No; don't ever do that. It is possible for an NSString to have zero
> length but not be empty. See <http://www.cocoabuilder.com/archive/message/cocoa/2004/7/5/111029
> > for details.
That isn't what Mike said. He said that it possible for a *non-empty*
string can be semantically equal to @"".
A string with 0 length is, obviously, always empty.
Jim
DATE : Sat Jun 28 20:09:11 2008
On Jun 26, 2008, at 8:32 PM, Nick Zitzmann wrote:
> On Jun 26, 2008, at 6:16 PM, William Squires wrote:
>
>> Actually, "if ([myString length] == 0)" is probably better, but
>> just IMHO... :)
>
> No; don't ever do that. It is possible for an NSString to have zero
> length but not be empty. See <http://www.cocoabuilder.com/archive/message/cocoa/2004/7/5/111029
> > for details.
That isn't what Mike said. He said that it possible for a *non-empty*
string can be semantically equal to @"".
A string with 0 length is, obviously, always empty.
Jim
| Related mails | Author | Date |
|---|---|---|
| David Brennan | Jun 26, 20:10 | |
| I. Savant | Jun 26, 20:15 | |
| David Brennan | Jun 26, 20:49 | |
| William Squires | Jun 27, 02:16 | |
| Nick Zitzmann | Jun 27, 02:32 | |
| Omar Qazi | Jun 27, 02:40 | |
| I. Savant | Jun 27, 02:46 | |
| James Walker | Jun 27, 03:29 | |
| Michael Ash | Jun 27, 05:30 | |
| Jim Correia | Jun 28, 20:09 | |
| Sean McBride | Jul 7, 18:10 |






Cocoa mail archive

