ios7 - NSPredicate to check for NULL, and blank strings in Core Data -
as coredata length not supported , coredata translates predicate name.length > 1 sqlite in name > 1... while should length(name) > 1.
we can use one: [nspredicate predicatewithformat:@"not name matches '^\s*$'"];
but regular expression have higher computation cost (takes longer evaluate regex simple equality).
so how have fetch.any best idea ?
please go through coredata predicate: string property length?
or can this
nsstring *attributename = @"name"; nsstring *attributevalue = [nsstring stringwithformat:@".{%d}", 5]; nspredicate *predicate = [nspredicate predicatewithformat:@"%k matches %@", attributename, attributevalue];
reference - nspredicate nsmanagedobject's string attribute's length
Comments
Post a Comment