icloud

Copying contacts from one source to another

筅森魡賤 提交于 2019-12-04 14:31:51
问题 I'm trying to copy contacts between my Local contact source and the iCloud contact source and I'm not seeing any results. This code executes without error and seems like it should work, but I don't see the newly created contacts afterward. Anyone see any issues with it? ABAddressBookRef addressBook = ABAddressBookCreate(); ABRecordRef abSourceSource = ABAddressBookGetSourceWithRecordID(addressBook, kABSourceTypeLocal); ABRecordRef abDestinationSource = ABAddressBookGetSourceWithRecordID

CloudKit: Preventing Duplicate Records

南笙酒味 提交于 2019-12-04 14:03:07
I am working through an app that pulls data from an external web service into a private CloudKit database. The app is a single user app, however I am running into a race condition that I am not sure how to avoid. Every record in my external data has a unique identifier that I map to my CKRecord instances. The general app startup flow is: Fetch current CKRecords for the relevant record type. Fetch external records. For every external record, if it doesn't exist in CloudKit, create it via batch create (modification operation). Now, the issue is, if this process is kicked off on two of a user's

Deleting data from cloudkit with swift

允我心安 提交于 2019-12-04 13:29:24
问题 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 webview. for example, when you enter www.hello.com, it goes into the cloud, and when you go to the webview on a different view controller it loads www.hello.com. My problem: When I enter a second url, it still loads the first one. How do I get it to load the

Core Data iCloud Syncing

佐手、 提交于 2019-12-04 13:06:06
I have implemented Core Data as local storage for a new app and now want to enable iCloud synchronising across devices. I've been reading the documentation and some tutorials but can't get my head around how to switch between local and cloud storage, and how to synchronise changes from iCloud when cloud storage is enabled. Would somebody mind summarising the process so I can then go and research each stage? Thanks in advance! I've managed to get this working by following this tutorial: http://corsarus.com/2015/using-core-data-in-ios-part-4-core-data-syncing-with-icloud/ To summarise the

turn off iCloud backup for my application iOS sdk

我的未来我决定 提交于 2019-12-04 12:37:00
I have some problems because of iCloud and i want to turn off its for my app,how can i do it in the code of my application,i thought about my problem and the decision can be turning off the iCloud, thanks for help If you store files in Documents, they will be backed up to iCloud automatically. If you don't want that, the easiest way is to just store them somewhere else. Library/Caches is a good choice. If you really MUST store in Documents but you want to disable iCloud backup you can use the technique outlined here: https://developer.apple.com/library/ios/#qa/qa1719/_index.html 来源: https:/

Magical Record and iCloud enabling/disabling

时光总嘲笑我的痴心妄想 提交于 2019-12-04 12:33:37
问题 How to handle correct the following flow using Magical Record ? Assume that my app enable feature to switch iCloud sync on/off. The user installs the app. On startup he is asked about iCloud preference. His choice: do not use iCloud. The user creates some data in the app. Then he decides to store it in iCloud and enables iCloud. Later by some reason the user disables iCloud in the app. Data should be left locally. How to setup Magical Record correctly? UPDATE: Source code 回答1: Implementing a

iOS: Migrating existing Core Data-database into iCloud

本秂侑毒 提交于 2019-12-04 12:19:07
问题 I'm using Core Data in an existing application. Now I want to integrate iCloud so that the user can synchronize their contents between their iOS-devices. To do that I've written the following code for my NSPersistentStoreCoordinator (of course the placeholders are filled out in my code): - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (persistentStoreCoordinator_ != nil) { return persistentStoreCoordinator_; } NSURL *storeURL = [[self applicationDocumentsDirectory]

UIManagedDocument migrate data model

跟風遠走 提交于 2019-12-04 11:48:32
I am working on an iPhone app that uses a subclass of UIManagedDocument and stores its documents on iCloud. It was all working fine until I changed my core data model / scheme (adding a new model version - like I had several times in the past few weeks). I added a new property and changed the data type of one of the existing properties. Now when I run my app I don't seem to be able to load my documents with UIManagedDocument 's -openWithCompletionHandler: . I can create new documents and read/write those. If I change the data model version back 1 then I am able to read the existing docs, but

iCloud syncing Ubiquity error

微笑、不失礼 提交于 2019-12-04 10:47:33
问题 I integrated iCloud in my application and the syncing works, but sometimes I get this error: +[PFUbiquityTransactionLog loadPlistAtLocation:withError:](324): CoreData: Ubiquity: Encountered an error trying to open the log file at the location: <PFUbiquityLocation: 0x1993c0>: /private/var/mobile/Library/Mobile Documents/ ... Error: Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256 - The item failed to download.)" -[PFUbiquityTransactionLog

Xcode error: failed to launch

别等时光非礼了梦想. 提交于 2019-12-04 10:36:38
问题 I have a Mac app I have written to support iCloud. However, I get this when trying to run the app: error: failed to launch /Users/padsoftware/Library/Developer/Xcode/DerivedData/Scrawl-heofvoywsunchdhjowxkvkoiqvan/Build/Products/Release/Scrawl.app/Contents/MacOS/Scrawl The odd thing is that this appears for all of my Mac apps, with or without iCloud, with or without sandboxing, with or without entitlements, or ever with or without code signing. Any idea on how to fix this? 回答1: I had this