Possible Duplicate:
Understanding NSString comparison in Objective-C
Header file:
@property (nonatomic, strong) NSString *pid;
@property (nonatomic, strong) NSString *name;
Coredata NSString stored:
[newPref setValue: @"0" forKey:@"pid"]; //correctly show in DB & NSLog
[newPref setValue: @"Sales" forKey:@"name"];
After later retrieving, evaluation fails:
if(preference.pid == @"0")
Debugger says:
_pid = (NSSting *) 0x... @"o\xee\"
_name = (NSString *) )x0.. @<variable is not NSString>
Is my storing of the NSString incorrect, or is my evaluation wrong? Note: The Coredata model is type string also.