Das Problem ist das:Wie baue ich dieses SUBQUERY NSPredicate?
Ich habe 3 Entitäten: ImgThumb, Img und BookmarkedItems. Sie haben die Beziehungen zwischen ihnen, wie folgt:
ImgThumb <-> Img (1 to 1)
Img <->> BookmarkItems (1 to many)
Jetzt, mit ein imgThumb Array Ich versuche, eine NSPredicate zu machen, die diese ImgThumbs Filter wie folgt:
- Ich brauche alle ImgThumbs, die nicht vorgemerkt sind .
Um dies zu erreichen Ich versuche, eine NSPredicate mit UNTERABFRAGE so zu bauen:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, [email protected] == 0)[email protected])[email protected]"];
Meine Anfrage wird mit Fehler:
Unable to generate SQL for predicate (0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, [email protected] == 0)[email protected])[email protected]) (problem on RHS)
Was mache ich falsch?