faqts : Computers : Programming : Application Frameworks : Macintosh : Cocoa

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

128 of 128 people (100%) answered Yes
Recently 10 of 10 people (100%) answered Yes

Entry

What's the difference between == and isEqualTo?

May 3rd, 2002 13:39
Christopher Holland, Donald Brown


Straight from the cocoa-dev list:
"isEqualTo is if you want to compare values.  "if (mystr==@"test")" will
never return true, because the pointer to mystr is different than the
pointer to @"test".  So, you'd use "if ([mystr isEqualTo:@"test")" to
compare the values.
To check to see if the two pointers are pointing to the same object, if
(sender==okButton) is both fastest and most reliable."