Possible Duplicate:
Understanding NSString comparison in Objective-C
I'v encountered strange things in objective-c, I'm trying to compare cell.label with elements title which is string. to identify whever it is a cell I am looking for.
NSLog(@"%@", cell.textLabel.text);
NSLog(@"%@", [_dropDownSelection1.elements[1] title]);
if(cell.textLabel.text == [_dropDownSelection1.elements[1] title]){
NSLog(@"Positive");
}
else{
NSLog(@"Negative");
}
NSLog prints that the text in both is exactly the same, but still i always end up with negative... Why is that?