Answer the question
In order to leave comments, you need to log in
[Core Data] NSPredicate + LIKE - why is it always 0 in the console?
I make a request from the console to the sqlite database: SELECT * FROM book WHERE title LIKE '%новые%';
in response to the request, I get the expected output.
I'm trying to set the same thing in iOS via NSPredicate:
NSFetchRequest *fetchRequest = ];
[fetchRequest setEntity:[NSEntityDescription entityForName:@"book" inManagedObjectContext:app.managedObjectContext]];
[fetchRequest setReturnsDistinctResults:YES];
[fetchRequest setPredicate:predicate];
NSArray *finding = [app.managedObjectContext executeFetchRequest:fetchRequest error:nil];
NSLog(@"%i", [finding count]);
Answer the question
In order to leave comments, you need to log in
https://developer.apple.com/library/ios/documentat...
LIKE
The left hand expression equals the right-hand expression: ? and * are allowed as wildcard characters, where ? matches 1 character and * matches 0 or more characters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question