title: Core data: detect when child has been deleted
body: <p>In my app, I have a <code>Result</code> entity, which can contains multiple <code>Expense</code> entities.</p>
  
  <p>Each <code>Expense</code> has an amount, and my <code>Result</code> contains the sum of the Expenses.</p>
  
  <p>I need to calculate automatically that sum when an <code>Expense</code> is added or deleted.</p>
  
  <p>I have succeeded in doing that when my <code>Expense</code> is added, overriding <code>didChangeValueForKey</code> from the <code>Expense</code> <code>NSManagedObject</code>. However, even if the method is called when the delete has taken effect, the reference to the <code>Result</code> object is nil. I have an idea using <code>willChangeValueForKey</code> to store the reference of my <code>Result</code> object, but I find this pretty dirty. </p>
  
  <p>Do you have a better idea so that the Result object gets notified when one of its child is deleted?</p>