Here is my code..
NSLog(@”%@”, [textField text]);
NsLog(@”%@”, entity.attribute);
The log shows me The values
123 and 123 as the correct values..
But this code is not works
If([textField text] == entity.attribute) NSLog(@”Correct!”);
The log “Correct!” is not shown..
What’s the problem?? Help plz
You are comparing NSString* pointers, not their values… they are different objects.
If both are non-nil (might want to check for that), the following will work: