cfischer
cfischer

Reputation: 24912

NSPredicate and KVC collection operators

Assume I have a Core Data class Employer with a 1-N relationship called employees.

This employees relationship maps to an NSSet. So far so good.

I want to create an NSFetchRequest of Employer with a predicate that requieres that employees > 0.

How can I create this predicate?

I tried "employees.@count", but it seems to consider the whole thing a keyPath.

Upvotes: 0

Views: 90

Answers (1)

Elise van Looij
Elise van Looij

Reputation: 4232

You got the syntax backwards:

@count.employees

Upvotes: 1

Related Questions