icloud

How to model my CloudKit data

眉间皱痕 提交于 2021-02-07 10:07:36
问题 In my app I decided to use CloudKit as my sync-backend. My app is not about projects, but for simplicity let's say so... So... In my app users will have multiple projects. Each of those contains multiple entities associated with that project. For example tasks, but also reminders and so on. All this data will be stored in the users private database. Nothing will be in the public database. Now a user can have multiple projects. My first question: Should each project be in it's own CKRecordZone

get icloud web service endpoints to fetch data

元气小坏坏 提交于 2021-02-07 06:56:34
问题 My question may look silly but I am asking this after too much search on Google, yet not have any clue. I am using iCloud web services. For that I have converted this Python code to PHP. https://github.com/picklepete/pyicloud Up to this, everything is working good. When authenticate using icloud username,password I am getting a list of web service URLs as part of response. Now for example to use Contacts web service, I need to use Contact web service URL and add a part to that URL to fetch

Forcing NSPersistentContainer change Core Data

痞子三分冷 提交于 2021-02-06 09:13:44
问题 I just added the option for a user to toggle Cloud sync inside my app where I save whether or not the user wants to use iCloud sync in UserDefaults under "useCloudSync". I load my persistentContainer when the app runs with: class CoreDataManager { static let sharedManager = CoreDataManager() private init() {} lazy var persistentContainer: NSPersistentContainer = { var useCloudSync = UserDefaults.standard.bool(forKey: "useCloudSync") let containerToUse: NSPersistentContainer? if useCloudSync {

Forcing NSPersistentContainer change Core Data

人走茶凉 提交于 2021-02-06 09:13:32
问题 I just added the option for a user to toggle Cloud sync inside my app where I save whether or not the user wants to use iCloud sync in UserDefaults under "useCloudSync". I load my persistentContainer when the app runs with: class CoreDataManager { static let sharedManager = CoreDataManager() private init() {} lazy var persistentContainer: NSPersistentContainer = { var useCloudSync = UserDefaults.standard.bool(forKey: "useCloudSync") let containerToUse: NSPersistentContainer? if useCloudSync {

Sharing a plist file using iCloud

眉间皱痕 提交于 2021-02-06 09:12:59
问题 I have a relativley simple app which persists data to a plist file located in the documents folder. The data loads into a UITableView at startup. The user can then edit, delete or add records and any changes get saved back to the plist file. Now I would like to share this data (the plist file) across devices using iCloud. I have looked at the documentation and my understanding is that I need to create a UIDocument to "manage" the plist file. I have looked at several iCloud tutorials however

Sharing a plist file using iCloud

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-06 09:12:34
问题 I have a relativley simple app which persists data to a plist file located in the documents folder. The data loads into a UITableView at startup. The user can then edit, delete or add records and any changes get saved back to the plist file. Now I would like to share this data (the plist file) across devices using iCloud. I have looked at the documentation and my understanding is that I need to create a UIDocument to "manage" the plist file. I have looked at several iCloud tutorials however

Which API is the replacement for Core Data with iCloud

筅森魡賤 提交于 2021-01-27 05:33:57
问题 Update, June 2016: As of the most recent documentation for NSPersistentStoreCoordinator, everything related to Core Data with iCloud is marked as deprecated. As a result it should probably be avoided for new development. Using Core Data, iCloud and CloudKit for syncing and backup and how it works together Important The use of iCloud with Core Data has been deprecated and is no longer being supported. About using iCloud with Core Data I've been reading about integrating iCloud with Core Data.

Determine if a file is inside any macOS Trash folder

本秂侑毒 提交于 2020-12-26 06:43:45
问题 There's a similar question for iOS, but I found that the proprosed solutions do not work on macOS in all cases. On a Mac, there are many possible Trash folders: /.Trashes ~/.Trash ~/Library/Mobile Documents/com~apple~CloudDocs/.Trash – this one is from iCloud /Users/xxx/.Trash – any other user's trash /Volumes/xxx/.Trashes This code should work but doesn't for the case of the iCloud trash: NSURL *theURL = ...; NSURLRelationship relationship = NSURLRelationshipOther; NSError *error = nil;

Determine if a file is inside any macOS Trash folder

怎甘沉沦 提交于 2020-12-26 06:43:03
问题 There's a similar question for iOS, but I found that the proprosed solutions do not work on macOS in all cases. On a Mac, there are many possible Trash folders: /.Trashes ~/.Trash ~/Library/Mobile Documents/com~apple~CloudDocs/.Trash – this one is from iCloud /Users/xxx/.Trash – any other user's trash /Volumes/xxx/.Trashes This code should work but doesn't for the case of the iCloud trash: NSURL *theURL = ...; NSURLRelationship relationship = NSURLRelationshipOther; NSError *error = nil;

How do I force iCloud to sync data of an App on fresh install / first launch?

隐身守侯 提交于 2020-12-15 06:03:51
问题 In a game I am working on I have implemented GKSavedGames and everything is working correctly except that if the game is uninstalled and reinstalled or installed on a new device the first initial launch fetchSavedGamesWithCompletionHandler returns 0 saved games. Is there a way to force iCloud to sync the files to the device? I have tried waiting and recalling fetchSavedGamesWithCompletionHandler but nothing seems to work. If I immediately relaunch the app all the save files are then available