0 Replies
      Latest reply on Jan 2, 2020 6:41 AM by Avsha
      Avsha Level 1 Level 1 (0 points)

        I tring to save an application data on cloudkit.

        When I check my application's icloud storage size(on settings->user->iCloud->backups->myy_app) is extemlly large (300K-500K) when I just save a short string.
        for example, I create a CKRecord object and set one key with short string value("a" for example), and send it to cloudkit. the storage size that shown is 300K.
        If I create CKRecord with long string (6000 chars) , I see the storage size is 1.1M.
        Why the storage size is so large? I know that the free storage limit is 1M.

        my code :


                    CKRecordID* record_id = [[[CKRecordID alloc] initWithRecordName:@"root"] autorelease];

                    CKRecord* record = [[[CKRecord alloc] initWithRecordType:@"root" recordID:record_id] autorelease];

                    [record setValue:[value dataUsingEncoding:NSASCIIStringEncoding] forKey:key];

                    CKModifyRecordsOperation *op = [[[CKModifyRecordsOperation alloc] initWithRecordsToSave:@[record] recordIDsToDelete:nil] autorelease];

                    op.savePolicy = CKRecordSaveAllKeys;

                    op.qualityOfService = NSQualityOfServiceUserInitiated;

                    [db addOperation:op];