2011-05-25 107 views
0

我做的版本,我添加一個字符串類型的新屬性屬性的coredata默認

它將是空起初我想創建一個謂詞來檢查空屬性我試過

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

但它不工作

這是什麼屬性的默認,以及如何檢測用空

回答

1
SeriesStudyID is NSString 

if ([SeriesStudyID length]<=0) { 

    NSLog(@"empty"); 
} 

else { 
    NSLog(@"not empty"); 
}