NSPredicate case-insensitive matching on to-many relationship

后端 未结 5 1562
攒了一身酷
攒了一身酷 2020-12-07 09:48

I am implementing a search field where the user can type in a string to filter the items displayed in a view. Each object being displayed has a keywords to-man

5条回答
  •  不知归路
    2020-12-07 10:39

    If you must match the keyword but the search must be case-insensitive then you should use NSPredicate(format: "keywords.name =[c] %@", self.searchString)

    LIKE does not work on string literals.

提交回复
热议问题