title: CloudKit Delete Self option for CKReference Doesn't work
body: <p>Does anybody have experience using the <code>CloudKit</code> option to <code>DeleteSelf</code> for a <code>CKReference</code>?  Here is what I got from the docs:</p>
  
  <blockquote>
    <p>DeleteSelf</p>
    
    <blockquote>
      <p>The delete action for referenced records. Deleting a record also deletes any records containing CKReference objects that point to that record. The deletion of the additional records may trigger a cascade deletion of more records. The deletions are asynchronous in the default zone and immediate in a custom zone.</p>
    </blockquote>
  </blockquote>
  
  <p>So I've been testing this out, I have created multiple <code>CKReference</code> objects both using the <code>CloudKit Dashboard</code> and by using my app. Whenever I do it with my app I create the reference like so:</p>
  
  <pre><code>let reference:CKReference = CKReference(recordID: savedFriend.friendID, action: CKReferenceAction.DeleteSelf)
  </code></pre>
  
  <p>I know that it is being assigned to delete itself, because in the dashboard it shows the option checked off:
  <a href="https://i.stack.imgur.com/cpEw1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cpEw1.png" alt="delete self checked off"></a></p>
  
  <p>I must be doing <em>something</em> wrong because whenever I go and manually delete that record that is referenced using the dashboard, or set my app to delete it programmatically, the record disappears but the reference never gets removed.  I thought maybe I should just wait and it would happen eventually, but hours later it's still there checked off like it should have deleted itself.  It's kind of frustrating because I designed some of my code assuming this would work, now I can have an app that's wasting resources trying to find a <code>CKRecord</code> that doesn't exist anymore.  Should I just not rely on this to ever work? I appreciate any help or advice I can get. </p>
  
  <p><strong>UPDATE ~ 04/07/2016</strong></p>
  
  <p>I jumped the gun coming back here and posting an update that the issue had resolved itself.  I wasn't totally convinced that the issue wouldn't pop back up so I sought some reassurance last night.  I created 5 different <code>CKRecords</code> and created various different <code>CKReference</code> objects to reference them throughout my database. I then proceeded to set the <code>CKReferenceAction.DeleteSelf</code> option on each reference (I tried two manually through the dashboard and the other three done programmatically).  Anyways, I waited a few minutes and then deleted the referenced records...after ten minutes the references were all still present.  I waited another 5-10 minutes and they were still there so I went to bed assuming they should definitely be gone by morning, right? Wrong! Twelve hours later the <code>CKReference</code> entries are <em>still there</em> and the referenced records are still gone.  I'm definitely scratching my head, it seems as though it's a bug with <code>CloudKit</code>.  I should mention that I've also noticed some weird behavior in my dashboard.  For the past four or so days, down in the bottom left hand corner it has consistently said it's "Reindexing development data", here is a picture for example:
  <a href="https://i.stack.imgur.com/oL24O.png" rel="noreferrer"><img src="https://i.stack.imgur.com/oL24O.png" alt="reindexing notification"></a></p>
  
  <p>Could that be causing this issue? Is anybody familiar with this issue and knows a way to solve this? Any suggestions would be appreciated.  I have filed a bug report with Apple. </p>