头文件:
@property (nonatomic, strong) NSString *pid;
@property (nonatomic, strong) NSString *name;
Coredata NSString 存储:
[newPref setValue: @"0" forKey:@"pid"]; //correctly show in DB & NSLog
[newPref setValue: @"Sales" forKey:@"name"];
稍后检索后,评估失败:
if(preference.pid == @"0")
调试器说:
_pid = (NSSting *) 0x... @"o\xee\"
_name = (NSString *) )x0.. @<variable is not NSString>
我的 NSString 存储不正确,还是我的评估错误?注意:Coredata 模型也是字符串类型。