title: Can't retrieve CKRecords to resolve conflicts on CKErrorCodeServerRecordChanged in CKModifyRecordsOperation
body: <p>I ran into some problem when trying to handle errors when doing batch operations on records in CloudKit.</p>
  
  <p>I am successfully extracting the dictionary containing the partial errors, which I can iterate over. However, I am not able to get the records needed to resolve the conflict for CKErrorCodeServerRecordChanged. According to the docs I should be able to get 3 records out of the dictionary:</p>
  
  <ul>
  <li>CKRecordChangedErrorServerRecordKey</li>
  <li>CKRecordChangedErrorAncestorRecordKey</li>
  <li>CKRecordChangedErrorClientRecordKey</li>
  </ul>
  
  <p>Thank you for any hints on what I am doing wrong here.</p>
  
  <pre><code>func pushRecordChangesForZoneID(recordZoneID: CKRecordZoneID) {
  // ...
  modifyRecordsOperation.modifyRecordsCompletionBlock = { (savedRecords, deletedRecordIDs, error) -&gt; Void in
      if (error != nil) {
          if error.code == CKErrorCode.PartialFailure.rawValue {
              if let errorDict = error.userInfo?[CKPartialErrorsByItemIDKey] as? [CKRecordID : NSError] {
                  for (recordID, partialError) in errorDict {
                      if partialError.code == CKErrorCode.ServerRecordChanged.rawValue {
                          if let userInfo = partialError.userInfo {
                              let serverRecord = userInfo[CKRecordChangedErrorServerRecordKey] as? CKRecord
                              // serverRecord will always be nil
                          }
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Additional information: When I print the description of the userInfo dict of the partial error (partialError.userInfo) it doesn’t look like it contains the other CKRecords:</p>
  
  <pre><code>[NSDebugDescription: CKInternalErrorDomain: 2037, NSLocalizedDescription: Error saving record &lt;CKRecordID: 0x7fb41bf7e640; DA39FE08-AB0B-4F07-A42E-F5732B114706:(userData:__defaultOwner__)&gt; to server: Protection data didn't match, NSUnderlyingError: &lt;CKError 0x7fd89a92d370: "Unknown Error" (2037)&gt;]
  </code></pre>
  
  <p>The description of the source error's dictionary (errorDict) looks like this (and I can successfully get the dictionary containing the recordIDs and partial errors out via CKPartialErrorsByItemIDKey):</p>
  
  <pre><code>[&lt;CKRecordID: 0x7fb5bb88afa0; C1575083-F992-448A-8D77-D62C4A42D696:(userData:__defaultOwner__)&gt;: &lt;CKError 0x7fb5b961c6a0: "Batch Request Failed" (22/2024); server message = "Atomic failure"; uuid = 1E4C0FD5-EC10-4071-B277-102A9F1B0E5E; container ID = "iCloud.net.neverthesamecolor.atsumeru"&gt;, &lt;CKRecordID: 0x7fb5bb848ad0; DA39FE08-AB0B-4F07-A42E-F5732B114706:(userData:__defaultOwner__)&gt;: &lt;CKError 0x7fb5b9653060: "Server Record Changed" (14/2037); "Error saving record &lt;CKRecordID: 0x7fb41bd9ca50; DA39FE08-AB0B-4F07-A42E-F5732B114706:(userData:__defaultOwner__)&gt; to server: Protection data didn't match"&gt;]
  </code></pre>