Possible Duplicate:
Checking for equality in Objective-C
I have following codes:
NSLog(@"Before, let's see what is in itemTitleField: %@", self.itemTitleField.text); NSLog(@"And the item title was: %@",self.item.title); if (self.itemTitleField.text == @"test") { NSLog(@"Look, I've got the new title: %@",self.itemTitleField.text); } else { NSLog(@"No the item title was different: %@", self.itemTitleField.text); }
And when I check the log it was displayed as following:
2013-02-04 09:59:03.308 Test[1275:11303] Before, let's see what is in itemTitleField: test 2013-02-04 09:59:03.309 Test[1275:11303] And the item title was: test 2013-02-04 09:59:03.309 Test[1275:11303] No the item title was different: test
I was expecting:
Look, I've got the new title: test