icloud

UIDocument not saving to file despite indicating success

廉价感情. 提交于 2019-12-20 11:13:08
问题 I'm trying to open, modify, and save a file in iCloud Drive using UIDocument . When I call save(to:for:completionHandler:) with the file location and using .forOverwriting for the UIDocumentSaveOperation , it completes with a status of success = true . However, the iCloud file (as seen in both desktop and iOS file browser) does not update, and when reopening the file, the changes are not shown. I've verified that contents(forType:) returns the correct (modified) file contents when saving.

Access to Safari bookmarks from another application

微笑、不失礼 提交于 2019-12-20 10:35:05
问题 I was wondering how we can access Safari bookmarks from another Cocoa application on Mac OS X, in a way that is safe and secure for the future. As you may know, two mechanisms were common to retreive Safari bookmarks: either read Safari's Bookmarks.plist file or use the SyncServices API. However, the first is forbidden by sandboxing (mandatory for a distribution through the App Store), and the second has been deprecated since Mac OS X 10.7 Lion. I believe that Apple deprecated SyncServices in

Relational Integrity and Validation in Core Data iCloud Syncing

▼魔方 西西 提交于 2019-12-20 10:27:00
问题 Consider the following simple entity model: Entity A has a to-one relationship to Entity B called b . Entity B has an inverse to-one relationship called a . Neither relationship is optional. A B b < ----- > a Assume we have two devices (1) and (2) that begin fully synced. Each has one object of class A, and one object of class B, and they are associated with one another. On device 1, we have objects A1 and B1, and on device B we have the same logical objects A1 and B1. Now assume that

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

Don't Backup to iCloud but still rejected

本小妞迷上赌 提交于 2019-12-20 09:02:59
问题 In my app i have to store Core Data Database and audio files, so i decoded to put them in Documents directory. To prevent them from backing up, when i first launch the app, i put the Don't BackUp flag like this - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self addSkipBackupAttributeToItemAtURL:[self applicationDocumentsDirectory]]; } - (NSURL *)applicationDocumentsDirectory { return [[[NSFileManager defaultManager]

How to check if iCloud is configured programmatically

故事扮演 提交于 2019-12-20 08:39:58
问题 Here is the sentence from Apple Docs: "If iCloud is not configured, ask users if they want to configure it (and, preferably, transfer them to Launch Settings if they want to configure iCloud)." How can I check if iCloud is configured or not and how to launch settings for iCloud? 回答1: Edit: If you are targeting iOS6 or above you can use [[NSFileManager defaultManager] ubiquityIdentityToken]; . For usage example please refer @Dj S' answer :). It is faster and easier than the original solution

Move local Core Data to iCloud

落爺英雄遲暮 提交于 2019-12-20 08:15:10
问题 How can I enable iCloud Core Data in an app which already uses local storage Core Data? I've tried to use NSPersistentStoreUbiquitousContentNameKey in my persistent store options. Unfortunately, this option enables iCloud but does not transfer any of the local data to iCloud. I can't seem to get migratePersistentStore:toURL:options:withType:error: to work either. I provide the persistent store, its URL, iCloud options, etc. and it still will not migrate the existing local data to iCloud. Here

Include iCloud on save dialog box in mac app

早过忘川 提交于 2019-12-20 03:48:06
问题 I have implemented the iCloud support on my Mac document-based app. NSDocument subclass can handle open e save file on local storage and iCloud . But, I can upload my files on iCloud only dragging it on the Open-New File Panel. When the app prompt the user the location to save the file, iCloud is not on the list. Isn't it supported by default like in TextEdit? I have to implement with my own code? Image here: 回答1: I managed to fix this problem by recreating certificates and provisioning

programmatically get ics file from icloud?

大城市里の小女人 提交于 2019-12-20 02:34:47
问题 I've been running a process for a client that involves grabbing their publicly available calendar file from me.com by making an https GET call in a ruby script, and then converting the data in the .ics file to html, then copying it to their website. They recently upgraded to Lion and iCloud, and it appears that, while the calendar I want is still publicly available, it's only usable by webCal enabled apps--I can no longer get it over https. I've poked around a bit on google, but haven't see

Still backups to iCloud even when addSkipBackupAttributeToItemAtURL is implemented?

江枫思渺然 提交于 2019-12-20 00:21:08
问题 My recent iOS app just got rejected because the application is storing data on Documents so it is backed up by iCloud, this is not allowed since the data is downloaded from a server. I'm trying to rebuild the code right now and have hit a tough spot when storing the data in the a folder calles Application Support instead. But even though I'm using addSkipBackupAttributeToItemAtURL it still shows up as a backup to iCloud. I'm only targeting 5.1 so it's not a versioning problem. I've added the