Basic data for many NSPredicate with AND

I am trying to write a query for the search by type search bar. I want to make a "Good" query and return any views that have LocalName ("name" LIKE% @AND localeIdentifier ==% @).

If I am only looking for names (so ignoring the localeIdentifier), I could do something like this:

ANY localized.name LIKE %@

What I want is more like

ANY localized.(name LIKE %@ AND localeIdentifier == %@)

To summarize, the search for "Good", any element in many ways "localized" must match both the name and the language identifiers.

Any ideas for the correct syntax for this?

+3
source share
1 answer

subquery. :

SUBQUERY(self.localized, $x, $x.name LIKE %@ AND $x.localeIdentifier == %@).@count > 0

SUBQUERY self.localized, . Kind , SUBQUERY (.. @count > 0) .

SUBQUERY OS X 10.5.

+9

Source: https://habr.com/ru/post/1734602/


All Articles