I have a class with an available method that returns an NSString when called.
[MyClass getMyString]
The string variable in this class is actually assigned to the didSelectRowAtIndexPath: table part as follows:
myString = cell.textLabel.text;
When I get a string by calling this method, I assign it to another string in the class that called it, and compare it to the string I defined
NSString *mySecondString; mySecondString = @"my value"; if(mySecondString == myString){ i = 9; }
I went through the code and every time he evaluates the if statement, it skips right past i=9 and goes on to the next else if . Why should it be? Why don't they value the same value? If you hover over each of the values โโduring debugging, they will show that they have the same value, but for some reason the code does not do what I expect and assign 9 i .
Any thoughts?
source share