Re: A bit stumped....
Re: A bit stumped....
- Subject: Re: A bit stumped....
- From: Jim Correia <email@hidden>
- Date: Fri, 20 Jul 2001 12:56:18 -0400
At 9:54 AM -0500 7/20/01, Andre Benassi wrote:
Cocoa NSStrings do not work like standard C Strings. You cannot compare
them using ==. Instead you need to send them as a message:
You can't do that with c strings either!
const char *one = "some text"
const char *two = "some text"
if (one == two)
NSLog(@"pointers are equal");
else
NSLog(@"pointers are not equal");
if (0 == strcmp(one, two))
NSLog(@"strings are equal");
else
NSLog(@"strings are not equal");