重複の可能性:
Objective-CでのNSString比較の理解
ヘッダーファイル:
@property (nonatomic, strong) NSString *pid;
@property (nonatomic, strong) NSString *name;
保存されたCoredataNSString:
[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モデルも文字列型です。