For some reason the argument I pass to my if statement is not true for even though it should be heres my code:
if (currentAttribute == cBusName)
{
NSLog(@"currentAttribute == cBusName");
}
current attribute and cBusName are both NSMutableStrings an both equal “1” but the NSLog never outputs the string in the console is there something I am missing???
The
==operator is comparing that those objects are the same object (IE they point to the same address in memory), not that their values are the same.Try
which compares the values of the two strings, not their location in memory.