I set up the following model in Core Data.
Book has a to-many relationship, called toBookOrders, with OrderBook entity. The inverse is called toBook. Book ha
Separate the isSync == 0 and SUBQUERY into separate NSPredicates, add them to an NSArray then use [NSCompoundPredicate andPredicateWithSubpredicates:array] to get them joined into a single one to pass to your NSFetchSpecification.
isSync == 0
SUBQUERY
NSPredicate
NSArray
[NSCompoundPredicate andPredicateWithSubpredicates:array]
NSFetchSpecification