Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A bit stumped....



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");


References: 
 >Re: A bit stumped.... (From: "Andre Benassi" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.