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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -