Why does NSString sometimes work with the equal sign? [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Understanding NSString comparison in Objective-C Was just reading up about equality vs identity and I realized that I've been using some equal signs when comparing strings in my objc code. The weird thing is that it actually works from times to times and I was wondering why. http://www.karlkraft.com/index.php/2008/01/07/equality-vs-identity/ I have two pieces of code, one work and one doesn't. WORKING. Here I