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.
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.
adam
added the question label 2025-12-29 15:27:10 +01:00
CoreStore still runs with NSPredicates in the back, so I think what you're looking for is the CONTAINS operation: https://stackoverflow.com/a/2741046
@JohnEstropia commented on GitHub (Oct 22, 2018):
CoreStore still runs with `NSPredicate`s in the back, so I think what you're looking for is the `CONTAINS` operation: https://stackoverflow.com/a/2741046
let predicate = NSPredicate(format: "title CONTAINS[cd] %@", searchText.lowercased()) allChats.refetch([OrderBy<ChatsData>(.descending(\.time)), Where<ChatsData>(predicate)])
@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)])`
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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):
👍