icloud

Set a lastModificationDate attribute after NSManagedObjectsDidChangeNotification creates an infinite loop

試著忘記壹切 提交于 2019-12-22 11:25:21
问题 I added a lastModifiedDate attribute to all my entities to avoid duplicates when syncing the UIManagedDocument with iCloud, something that I found it can happen if I create new entities with an offline device (iPad) and, at the same time, I create the same entities using another online device (iPhone). I wanted to set this attribute whenever an object changes so I subscribed for NSManagedObjectContextObjectsDidChangeNotification . The code I wrote to set the lastModifiedDate creates an

NSURLThumbnailDictionaryKey empty for local file

Deadly 提交于 2019-12-22 08:44:43
问题 I want to get a thumbnail representation of a file I have to display in my app. I'm using NSURL here: NSDictionary *thumbnails = nil; BOOL success = [fileURL getResourceValue:&thumbnails forKey:NSURLThumbnailDictionaryKey error: &error]; This works fine if I am connected to iCloud, and the URL is a link to a file stored in iCloud. The fileURL is something like: file:///Users/me/Library/Mobile%20Documents/BJXXGLR9R3~com~myapp~icloud/FileStorage/contact-page%20copy.png If I use the same code

How can I act on Core Data iCloud sync notification when the app is in the background?

烂漫一生 提交于 2019-12-22 08:27:31
问题 I have an iOS app that uses Core Data with iCloud sync. The app is working perfectly and syncing across multiple devices. As part of my implementation my app is registered for the: NSPersistentStoreCoordinatorStoresDidChangeNotification This notification works perfectly with the app in the foreground, but what I would like to do is fire a local notification to let the user know that the iCloud data in the app has changed, whenever the app is in the background and a sync notification comes in.

How to delete iCloud documents?

依然范特西╮ 提交于 2019-12-22 05:06:25
问题 I'm using a UIDocument with iCloud. I'm not using CoreData. What's the best way to delete a UIDocument? 回答1: To delete the document from iCloud, first you have to get the filename you want to delete. and then you can delete it using NSFileManager. NSString *saveFileName = @"Report.pdf"; NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; NSURL *ubiquitousPackage = [[ubiq URLByAppendingPathComponent:@"Documents"] URLByAppendingPathComponent:saveFileName];

iCloud Time out. (using iCloud + Core Data + Magical Record

柔情痞子 提交于 2019-12-22 04:50:50
问题 I started an app test to use Core Data and iCloud (using Magical Records). After a lot of troubles to configure Provisioning Profiles and Entitlements, the app finally runs. After a while the app crash and throw this message:: 2012-12-31 03:42:07.079 iCloudTest[252:1103] -[PFUbiquitySafeSaveFile waitForFileToUpload:](268): CoreData: Ubiquity: <PFUbiquityPeerReceipt: 0x1cd5a420>(0) permanentLocation: <PFUbiquityLocation: 0x1cd57b30>: /private/var/mobile/Library/Mobile Documents/MA5BADG5AW~com

Core Data and iCloud adding Pre-Populated sqlite file

别等时光非礼了梦想. 提交于 2019-12-21 23:55:40
问题 I'm working on an app that uses Core Data and iCloud to sync data between multiple iPads. This is all working fine and I can add data to each iPad and it will sync between them all. I have a Core Data sqlite file that is pre-populated with a list of countries and I want to copy this to the documents area on first run of the app. I had this working but have changed my persistentStoreCoordinator implementation to test for iCloud support or not and a couple of other small changes. However now

iCloud calendar synchronization issue while creating calendar from application

≡放荡痞女 提交于 2019-12-21 20:28:50
问题 Trying to implement iCloud Calendar synchronization for iOS. The idea is to create a new calendar from my app and sync it with iCloud when iCloud sync is on actually. To get corresponding source I'm using the following code: EKSource* localSource=nil; for (EKSource* source in self.eventStore.sources) { if(source.sourceType == EKSourceTypeCalDAV && [source.title isEqualToString:@"iCloud"]) { localSource = source; break; } } Then creating a calendar in that source and saving. When iCloud sync

How do you detect when a file is changed in iCloud?

时间秒杀一切 提交于 2019-12-21 15:45:33
问题 When a file is changed in iCloud (whether added, deleted, or the content changed), I would like to call a method I created ( [self methodName] ) so that I can update my table view with the names of the new files. How am I notified of the file change? Do I need to listen for a NSNotification (if so, what is it?) or do I have to check manually? Thanks. 回答1: The name of the NSNotification I have to listen for is NSMetadataQueryDidUpdateNotification . This is how I did it: [[NSNotificationCenter

How do you detect when a file is changed in iCloud?

孤街浪徒 提交于 2019-12-21 15:45:31
问题 When a file is changed in iCloud (whether added, deleted, or the content changed), I would like to call a method I created ( [self methodName] ) so that I can update my table view with the names of the new files. How am I notified of the file change? Do I need to listen for a NSNotification (if so, what is it?) or do I have to check manually? Thanks. 回答1: The name of the NSNotification I have to listen for is NSMetadataQueryDidUpdateNotification . This is how I did it: [[NSNotificationCenter

How do I tell how much iCloud space my app uses?

∥☆過路亽.° 提交于 2019-12-21 12:57:20
问题 Is there a way to see what my app is backing up to iCloud, and how much memory it consumes? 回答1: Settings > iCloud > Storage & Backup > Manage Storage will show you the aggregate total of what is being backed up. iOS backs up any files located in your application’s sandbox, except those located in <Application_Home>/Library/Caches . Technical Q&A QA1719 has more on how to not back up data in iOS 5.0.1 and later. 回答2: If you just want to see, you can go into Settings->iCloud->Storage & Backup-