title: Using NSPredicate with Core Data for deep relationships
body: <p>I have an NSArrayController, <code>companiesController</code> bound to a top level Core Data entity, <code>Companies</code>. </p>
  
  <p>A <code>Company</code> has many <code>Department</code>'s, and a <code>Department</code> has many <code>Employee</code>; these are represented by the 1-to-many relationships, <code>departments</code> and <code>employees</code>.                </p>
  
  <p>Based on the attribute <code>salary</code> of an <code>Employee</code> I thought I could dynamically do this for filtering based on salary inside a UI-called method:</p>
  
  <pre><code>NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY departments.employees.salary &lt; %@", [NSNumber numberWithInt:23000]];
  [companiesController setFilterPredicate:predicate];
  </code></pre>
  
  <p>Alas, this gives me the error: <code>-[NSCFSet compare:]: unrecognized selector sent to instance</code>.</p>