I am trying to compare strings and I'm not getting the logical result desired. I am getting the opposite. I would appreciate if anyone could point what I am doing wrong:
I have a data string that logs to console as "notfound"
if (![self.receivedDataString isEqual: @"notfound"]) {
// IT SHOULD NOT BE EQUAL TO "notfound" BUT THIS IS GETTING CHOSEN
NSLog(@"first option");
} else {
//IT SHOULD EQUAL "notfound"
NSLog(@"second option");
}
EDIT:
Here is receivedDataString
self.receivedDataString= [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];