AMH
AMH

Reputation: 6451

the default of attribute in coredata

I did versioning and I added a new attribute of type string

it will be empty at first I want to create a predicate to check for the empty attribute I tried

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

but it doesn't work

what's the default of this attribute and how to detect the empty

Upvotes: 0

Views: 90

Answers (1)

SeriesStudyID is NSString

if ([SeriesStudyID length]<=0) {

    NSLog(@"empty");
}

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

Upvotes: 1

Related Questions