If “a == b” is false when comparing two NSString objects
问题 I have a class with an accessible method that passes back an NSString when called. [MyClass getMyString] The string variable in that class is actually assigned in the didSelectRowAtIndexPath: part of a table like this: myString = cell.textLabel.text; When I retrieve the string by calling that method, I assign it to another string in the class that called it and compare it to a string I have defined NSString *mySecondString; mySecondString = @\"my value\"; if(mySecondString == myString){ i = 9