I am trying to search in CoreData for an object that matches both a recordId and a string name, but it doesn't always find the object. For example, I an searching for an object with id 1000 and name "The Brown Family" (note the 2 spaces between "The" and "Brown"). If I use:
NSPredicate *pred = [NSPredicate predicateWithFormat:@"(recordId == %@") AND (name like[cd] %@)", recordId, name];
with recordId=1000 and name="The Brown Family", the fetch request returns nil. If I use:
NSPredicate *pred = [NSPredicate predicateWithFormat:@"(recordId == %@"), recordId];
with recordId=1000, it finds the object. If I print the object's name property, I get "The Brown Family". So the object is there with the correct id and name, but my fetchRequest fails. What am I doing wrong?