for some reason, I can't get a string compare to return true, even though the two strings are identical.
First I tried:
This did not work.
Then I tried:
This did not work either. I also tried upper and lower casing the strings before the compare, but that did nothing. I also tried caseInsensitiveCompare:
I logged the two strings to the console before the compare, and they appear identical to each other. I'm beginning to think that maybe there is some difference in the format of the two strings. I'm declaring both of them as NSStrings.
Does anybody have any suggestions?
First I tried:
Code:
if (string1 == string2) {
NSLog(@"Strings Match");
}
Then I tried:
Code:
if ([string1 compare: string2] == YES) {
NSLog(@"Strings Match");
}
I logged the two strings to the console before the compare, and they appear identical to each other. I'm beginning to think that maybe there is some difference in the format of the two strings. I'm declaring both of them as NSStrings.
Does anybody have any suggestions?