coredata中属性的默认值

时间:2011-05-25 09:29:27

标签: iphone objective-c ipad core-data

我进行了版本控制,并添加了一个类型为string

的新属性

一开始它会为空我想创建一个谓词来检查我尝试的空属性

[fetchRequest setPredicate:[NSPredicate predicateWithFormat:
                            @"( SeriesStudyID == '""' )"  ]]; 

但它不起作用

此属性的默认值以及如何检测空

1 个答案:

答案 0 :(得分:1)

SeriesStudyID is NSString

if ([SeriesStudyID length]<=0) {

    NSLog(@"empty");
}

else {
    NSLog(@"not empty");
}
相关问题