Possible Duplicate:
Understanding NSString comparison in Objective-C
Code
NSString *nodeType = [subNodeDict objectForKey:@"nodeType"];
NSLog (@"nodeType = %@", nodeType);
NSLog (@"(nodeType == @\"Collection\") = %d", nodeType == @"Collection");
NSLog (@"[nodeType class] = %@ and [@\"Collection\" class] = %@", [nodeType class], [@"Collection" class]);
Log
2013-01-01 04:06:37.895 GoogleClient[4752:c07] <strong>nodeType = Collection
2013-01-01 04:06:37.896 GoogleClient[4752:c07] <strong>(nodeType == @"Collection") = 0
2013-01-01 04:06:37.896 GoogleClient[4752:c07]
<strong>[nodeType class] = __NSCFString and [@"Collection" class] = __NSCFConstantString
subNodeDict
is a JSON response object coming back from the server via AFNetworking.
I can't figure out how to accurately compare a string coming back from the server to a constant string. All non-string objects within subNodeDict work fine. Is there some type of UTF-8 encoding that I need to be using? How can I get the true value nodeType?