cloudkit

Fetching CKAsset Image From CloudKit is Very Slow

穿精又带淫゛_ 提交于 2019-12-20 12:43:20
问题 I am using CloudKit as a server backend for my iOS application. I'm using it to house some relatively static data along with a handful of images(CKAsset). I ran into a problem when the time came for me to actually fetch those assets from the public database. They load at an excruciatingly slow speed. My use case is to load an image into every cell inside of a collection view. The images are only 200kb in size, but the fetch process took an average of 2.2 seconds for the download to complete

How to query CloudKit for recordID IN [CKRecordID]

扶醉桌前 提交于 2019-12-20 12:38:45
问题 My predicate wants to exclude some records that are already downloaded and available in a [CKRecordID]. Now I can query 1 CKRecordID[0], but not the [CKRecordID] array. How can I query the array? let excludeIDs: [CKRecordID] This works: let pred1 = NSPredicate(format: "NOT(recordID = %@)", excludeIDs[0]) But this doesn't: let pred1 = NSPredicate(format: "NOT(recordID IN %@)", excludeIDs) ERROR: loadImageCompareRecordIDsAndEndDateThatHaveNotEnded Error: Invalid predicate: Invalid predicate:

How to set up a minimal CKSubscription?

让人想犯罪 __ 提交于 2019-12-20 12:38:07
问题 I want to set up a simple CKSubscription that notifies me a recordType was created, how? 回答1: After experimenting a while this is how to setup a minimal CKSubscription. You have to test it on Device, push notification does not work on simulator. You can add record in Dashboard, that will trigger push notification too. func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { application.registerUserNotificationSettings

CloudKit share Data between different iCloud accounts but not with everyone

六眼飞鱼酱① 提交于 2019-12-20 09:32:04
问题 In my app I want to share data via iCloud with other iCloud users but not with the whole world but with selected other iCloud users. I thought about a way this could work, but I am not sure if it will work and if I forgot or misunderstood some things. Let s say User A wants to be able to share a string with other iCloud users but not with everyone. So User A wants to share „Hello World“ to User B but not to user C and not to User D. So my app has a Public Data Base and a Record Type that is

CloudKit records saving progress

老子叫甜甜 提交于 2019-12-20 04:56:47
问题 I want to save Event and Image (for event) records. I want to show uploading progress in UI. Event is little object with text and location. Image is big object with photo as UIImage. Image record is first item in array, event is second. I create CKModifyRecordsOperation and set two CKRecord objects to recordsToSave Than I set perRecordProgressBlock : [operation setPerRecordProgressBlock:^(CKRecord *record, double progress) { NSLog(@"#record: %@ progress: %f", record.recordType, progress); }];

CloudKit records saving progress

隐身守侯 提交于 2019-12-20 04:56:02
问题 I want to save Event and Image (for event) records. I want to show uploading progress in UI. Event is little object with text and location. Image is big object with photo as UIImage. Image record is first item in array, event is second. I create CKModifyRecordsOperation and set two CKRecord objects to recordsToSave Than I set perRecordProgressBlock : [operation setPerRecordProgressBlock:^(CKRecord *record, double progress) { NSLog(@"#record: %@ progress: %f", record.recordType, progress); }];

NSPredicate with OR returning error

北城余情 提交于 2019-12-20 03:33:21
问题 I have a problem with the following predicate: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(creatorUserRecordID == %@) OR (toUser == %@)", userId, userId]; When I use it in query CKQuery *query = [[CKQuery alloc] initWithRecordType:@"Message" predicate:predicate]; I have an error that says: 'CKException', reason: 'Unexpected expression'. When I use these two seperately like this: NSPredicate *predicate1 = [NSPredicate predicateWithFormat:@"(creatorUserRecordID == %@)", userId]

CKQueryOperation queryCompletionBlock only runs 3 times

老子叫甜甜 提交于 2019-12-19 17:32:39
问题 I'm trying to download a batch of records from my iCloud public database using CloudKit and the cursor. The code works fine for the first 3 executions, regardless of how the resultsLimit is set, but the 4th completion block is never executed. If resultsLimit is not set I get 300 records, if it's set to 50 I get 150, if it's set to 5 I get 15... No error is reported and the block appears to be added but is never executed. Platform is OS X. Here's the code in question: let queryOp =

CKQueryOperation queryCompletionBlock only runs 3 times

我与影子孤独终老i 提交于 2019-12-19 17:32:33
问题 I'm trying to download a batch of records from my iCloud public database using CloudKit and the cursor. The code works fine for the first 3 executions, regardless of how the resultsLimit is set, but the 4th completion block is never executed. If resultsLimit is not set I get 300 records, if it's set to 50 I get 150, if it's set to 5 I get 15... No error is reported and the block appears to be added but is never executed. Platform is OS X. Here's the code in question: let queryOp =

Field '___recordID' is not marked queryable

二次信任 提交于 2019-12-19 15:04:59
问题 I try to download all record with a specific recordType that recordID is not matches with a certain one. But I get an error. Any idea? I thought I can mark as queryable only manually added fields. <CKError 0x15df2a10: "Invalid Arguments" (12/2015); server message = "Field '___recordID' is not marked queryable"; uuid = ECDD0C97-550F-4DD5-942D-AF4DF8917EEB; container ID = "iCloud.com.kukodajanos.Movie-Buffs"> let query = CKQuery(recordType: "UserSetting", predicate: NSPredicate(format: