mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 07:33:28 +01:00
Refetch sql query LIKE #236
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dufflink on GitHub (Oct 21, 2018).
Hi
I have a problem.
allChats.refetch([OrderBy<ChatsData>(.descending(\.time)), Where<ChatsData>("title LIKE '%a%' ")])This request should return to me all objects of class ChatsData, whose name contains the character 'a'. But he doesn't do it.
@JohnEstropia commented on GitHub (Oct 22, 2018):
CoreStore still runs with
NSPredicates in the back, so I think what you're looking for is theCONTAINSoperation: https://stackoverflow.com/a/2741046@dufflink commented on GitHub (Oct 22, 2018):
Thank you very much! This code work for me
let predicate = NSPredicate(format: "title CONTAINS[cd] %@", searchText.lowercased())allChats.refetch([OrderBy<ChatsData>(.descending(\.time)), Where<ChatsData>(predicate)])@JohnEstropia commented on GitHub (Oct 22, 2018):
👍