Start a new topic

Trouble creating a query using "CONTAINS"

I'm following the syntax from https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Predicates/Articles/pSyntax.html


let containsPredicate = NSPredicate(format: "self.name CONTAINS[c] %@", searchString)

Using the above, I get an error with the description: Regular expression in queries must be anchored at the beginning (they must start with ^)


Any idea why I'm running into this problem?


1 person has this question
1 Comment

Have the same issue 

Login or Signup to post a comment