title: NSFetchRequest and predicateWithBlock
body: <p>I am playing with an app that uses Core Data and NSManagedObjects to populate a UITableView.  There is only one class in my application, called <code>Event</code>.  I have created the following custom instance method on <code>Event</code>:</p>
  
  <pre><code>- (BOOL)isExpired {
      return ([[self.endOn dateAtEndOfDay] timeIntervalSinceNow] &lt; 0);
  }
  </code></pre>
  
  <p>I would like to limit the <code>UITableView</code> that displays <code>Event</code> objects to only the Events that are expired - that is, where <code>isExpired</code> returns <code>YES</code>.  I have tried to do this by adding an <code>NSPredicate</code> to the <code>NSFetchRequest</code>:</p>
  
  <pre><code>NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary * bindings) {return([evaluatedObject isExpired]);}];
  [fetchRequest setPredicate:predicate];
  </code></pre>
  
  <p>but I get the error: <code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Problem with subpredicate BLOCKPREDICATE(0x272ac)'
  ***</code>.  Does this mean that you can't use a block predicate with an NSFetchRequest?  Or have I just constructed it improperly?</p>
  
  <p>Thank you!</p>