FAQ Database Discussion Community

Deleting data from cloudkit with swift

How do I delete some data I put into the cloud? I made an app that when you enter a url in 1 view controller it uploads into the cloud, and when you go to another view controller it shows the url you entered before from the cloud in a...

Cannot assign userID as reference

I am trying to assign several different attributes to a record. Date & Name are working properly. Avatar, which is a reference to another record, works also fine. But then I try to assign a reference to the user and I get the slamyourheadagainstthescreen moment. Here is my code: var...

iCloud application back-up size

I was wondering if there is a limit to the size of an iOS application back-up on iCloud (the application doesn't use iCloud to save progress).My app makes a back-up of 1.1 MB. I asked some friends and some of them told me that the limit is 1 MB others...

How to approve uploads to CloudKit

When creating an application that uses CloudKit, sometimes you allow the user to create and upload data to the public database which will be publicly available to everyone once it's created. This leads to my question which is: How do you review/moderate/approve user created data before making it available to...

Is it possible to obtain an unique iCloud user ID on cocoa?

My iOS app is currently on beta in TestFlight, and as a way to retribute to the nice people who helped me test it I would like to offer them some goodies such as, for instance, the full final version of the app for free. For this, I was thinking...

iOS Swift: Sort array into multidimensional array

I have an array of CKRecords. Each record has startTime and a Name, among other values. What I would like to do is sort the records first by unique startTime and then within each startTime sort by unique Name. The end result would be an array that looks like this...

CloudKit: Order query results by creation date

When loading items from CloudKit I would like to order the results by creation date. I believe now it's sorting by the first property of the record. func loadItems() { let predicate = NSPredicate(value: true) let query = CKQuery(recordType: "Items", predicate: predicate) db.performQuery(query, inZoneWithID: nil) { (results, error) -> Void...

Full CoreData uploading (backup) to iCloud Drive and restore if need

My project is CoreData-based application. Is it enough to upload sqlite-file to CloudDrive for restoring data when need? Is there any tutorials how to implement it?

NSMetadataQuery returns files which apparently don't exist

I've recently start integrating iCloud functionality into an application. I have 2 test spreadsheets which worked correctly when uploaded to iCloud through my application (for test purposes). Now when I drop more spreadsheets into the appropriate iCloud application folder that now appears in my Mac's Finder window, the application sees...

Since iOS8 we should use CloudKit for all iCloud apps?

I've noticed a lot of people creating iCloud apps using Obj-C and importing .h etc. To a noob like me it seems very complex since I've been using Swift from the beginning. People say iCloud apps can be created using only Swift and CloudKit exclusively. Is it possible? Thanks

How can I delete a file from iCloud without downloading it to the device first?

I have a basic iOS app that shows a list of documents. I'm trying to delete a document, but noticed that the code below fails with "No such file or directory" if the document has not yet been downloaded from iCloud to the device. Documents can be quite large (40MB)...

Xamarin iOS: Can't fetch record from private database in icloud

Want to save a asset to the private database but.... ...my output says every launch "creating file...", so where's the problem at my code? :( (uploading/saving seems to work because "uploaded" appears) var recordID = new CKRecordID("diary"); AppleHelper.PrivateDatabase.FetchRecord(recordID, (record, err) => { // Was there an error? if (err !=...

Share task list between people using iCloud

I'd like to create an iOS app for shopping lists (yeah, one more), allowing synchronization between 2 (or more) iCloud users (like what Apple does with shared calendars). Any idea how I should structure my data to accomplish that ? Can I do that with the tools iCloud offers at...

CoreData (+ iCloud) produces invalid model state

I'm using CoreData with iCloud to sync data between devices. After every iCloud import (observing NSPersistentStoreDidImportUbiquitousContentChangesNotification), I run a simple de-duplication algorithm to find and delete duplicated data. After saving the changes I see warnings in the console from CoreData that all properties and relationships of a specific entity instance...

CloudKit: Fetch all records with a certain record type?

I have currently got CloudKit set up in my app so that I am adding a new record using the help of the following code below, CKRecordID *recordID = [[CKRecordID alloc] initWithRecordName:@"stringArray"]; CKRecord *record = [[CKRecord alloc] initWithRecordType:@"Strings" recordID:recordID]; [record setObject:[NSArray arrayWithObjects:@"one", @"two", @"three", @"four", nil] forKey:@"stringArray"]; [_privateDatabase saveRecord:record completionHandler:nil];...

Missing iCloud logging “Using local storage: 0”

I'm creating iCloud enabled storage following Apple's instruction here. However, I don't see "Using local storage: 1" or "Using local storage: 0" being printed on the console using the latest xCode 6.1.1 for iOS8. Did Apple drop these prints?

cloudkit custom container name

I've downloaded apple's CloudKitAtlas sample code to learn about cloudkit. To run it I have to change the container name. But I wasn't able to do it so far. I cannot use the default's container. And when I click "specify custom containers" and add one, I always get two errors...

How to check which files are stored on iCloud?

My app have been rejected by Apple, and the cause is "Apps must follow the iOS Data Storage Guidelines or they will be rejected". My app is based on Phonegap so it has many offline files(html,js,css) stored in Documents/myApp directory. I added NSURLIsExcludedFromBackupKey variable to the dir. However, when I...

Using iCloud enabled Core Data NSArray-taking method

I've been setting up and testing Core Data in my app and everything works great locally; however, as soon as I enable iCloud via: NSDictionary *options; if ([self iCloudEnabled]) { options = @{NSSQLitePragmasOption: @{@"journal_mode" : @"DELETE"}, NSPersistentStoreUbiquitousContentNameKey : @"iCloudStore"}; [self subscribeToNotifications]; } else options = @{NSSQLitePragmasOption: @{@"journal_mode" : @"DELETE"}}; And...

How to keep data from iCloud(CloudKit) loaded after switching view controllers

I am in the process of making an app using CloudKit, but I have recently run into a problem. In my app, as soon as the main view controller loads, it goes off and fetches data from iCloud. The problem is that when I segue to another view controller and...

How to enable iCloud for Core Data?

This is the first time I'm trying to make this work. I'm following the iCloud Programming Guide for Core Data, the "Using the SQLite Store with iCloud" section, and in AppDelegate I have: - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { // The persistent store coordinator for the application. This implementation creates and return...

How to organize icloud data by date added?

I am making an app that uses cloud-kit, and when I ask it to return the data saved on it, its out of order. How to i organize the data by date? And then save it in an array, with array [0] as the most recent data added? by the...

Estimating and measuring CloudKit database usage

CloudKit has some pretty stringent data limits, restricting to 50MB of database storage plus 1MB per user, with 250KB/day in database bandwidth plus 5KB per user. To find out how CloudKit incorporates database structure and protocol overheads into these numbers, is there a dashboard I'm able to look at to...

iCloud Drive documents not included in NSMetadataQuery results

I have a basic iOS 8 app that lists the user's documents in the app's iCloud container and also in iCloud Drive. My problem is that documents that are directly in iCloud Drive (Finder → Go → iCloud Drive) are not included as results of the metadata query. The query...

iOS Swift: Crash on deleteRowsAtIndexPaths

I'm getting a crash when I remove a row from a tableView. Not sure what's going on. Here is my code: func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { let items = days[indexPath.row] self.removeItems(items, indexPath: indexPath) } func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return days.count...