                             }
                         }
                         
-    //                    else
-    //                    {
-    //                        var relationshipManagedObjects:Array<AnyObject> = managedObject.valueForKey(relationshipDescription.name) as! Array<AnyObject>
-    //                        var ckReferences = relationshipManagedObjects.map({(object)->CKReference in
-    //                            
-    //                            var managedObject:NSManagedObject = object as! NSManagedObject
-    //                            var ckRecordID = CKRecordID(recordName: managedObject.valueForKey(CKSIncrementalStoreLocalStoreRecordIDAttributeName) as! String, zoneID: CKRecordZoneID(zoneName: CKSIncrementalStoreCloudDatabaseCustomZoneName, ownerName: CKOwnerDefaultName))
-    //                            var ckReference = CKReference(recordID: ckRecordID, action: CKReferenceAction.DeleteSelf)
-    //                            return ckReference
-    //                        })
-    //                        ckRecord.setObject(ckReferences, forKey: relationshipDescription.name)
-    //                    }
+                        //                    else
+                        //                    {
+                        //                        var relationshipManagedObjects:Array<AnyObject> = managedObject.valueForKey(relationshipDescription.name) as! Array<AnyObject>
+                        //                        var ckReferences = relationshipManagedObjects.map({(object)->CKReference in
+                        //
+                        //                            var managedObject:NSManagedObject = object as! NSManagedObject
+                        //                            var ckRecordID = CKRecordID(recordName: managedObject.valueForKey(CKSIncrementalStoreLocalStoreRecordIDAttributeName) as! String, zoneID: CKRecordZoneID(zoneName: CKSIncrementalStoreCloudDatabaseCustomZoneName, ownerName: CKOwnerDefaultName))
+                        //                            var ckReference = CKReference(recordID: ckRecordID, action: CKReferenceAction.DeleteSelf)
+                        //                            return ckReference
+                        //                        })
+                        //                        ckRecord.setObject(ckReferences, forKey: relationshipDescription.name)
+                        //                    }
                     }
                 }
                 

                        var attributeDescription:NSAttributeDescription = property as! NSAttributeDescription
                        switch attributeDescription.attributeType
                        {
                            case .StringAttributeType:
                                ckRecord.setObject(managedObject.valueForKey(attributeDescription.name) as! String, forKey: attributeDescription.name)
                                
                            case .DateAttributeType:
                                ckRecord.setObject(managedObject.valueForKey(attributeDescription.name) as! NSDate, forKey: attributeDescription.name)
                                
                            case .BinaryDataAttributeType:
                                ckRecord.setObject(managedObject.valueForKey(attributeDescription.name) as! NSData, forKey: attributeDescription.name)
                                
                            case .BooleanAttributeType, .DecimalAttributeType, .DoubleAttributeType, .FloatAttributeType, .Integer16AttributeType, .Integer32AttributeType, .Integer32AttributeType, .Integer64AttributeType:
                                ckRecord.setObject(managedObject.valueForKey(attributeDescription.name) as! NSNumber, forKey: attributeDescription.name)
                                
                            default:
                                break
                        }
                    }
                    else if property is NSRelationshipDescription

            NSUserDefaults.standardUserDefaults().setObject(nil, forKey: CKSIncrementalStoreSyncOperationFetchChangeTokenKey)
        }
    }

    // MARK: Local Changes
    func localChanges()->(insertedOrUpdatedManagedObjects:Array<AnyObject>,deletedManagedObjects:Array<AnyObject>)
    {
        var entityNames = self.localStoreMOC?.persistentStoreCoordinator?.managedObjectModel.entities.map({(entity)->String in
