icloud

UIDocument never calling dealloc

旧巷老猫 提交于 2019-12-23 19:45:24
问题 I have an issue where I can't seem to dealloc UIDocument (used in iCloud) After running an NSMetaDataQuery to look for the document as follows.. NSMetadataQuery *query = [[NSMetadataQuery alloc] init]; _query = query; [query setSearchScopes:[NSArray arrayWithObject: NSMetadataQueryUbiquitousDocumentsScope]]; NSPredicate *pred = [NSPredicate predicateWithFormat: @"%K == %@", NSMetadataItemFSNameKey, kFILENAME]; [query setPredicate:pred]; [[NSNotificationCenter defaultCenter] addObserver:self

How to detect if the user has iCloud enabled for my app?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 09:33:06
问题 I have developed an iCloud enabled iPhone App, but the issue I m facing is that even if user turn off iCloud backup for my App then also it takes back up on iCloud and reflect changes on my other devices, so I want to know that how can I get that my App is iCloud enabled or not. It's specifically for App not for Device, if device is iCloud enabled but my App is turned off then it should not take any back ups. 回答1: Please use this to check the status of your iCloud whether it is enabled or not

NSUbiquityIdentityDidChangeNotification and SIGKILL

て烟熏妆下的殇ゞ 提交于 2019-12-23 07:41:08
问题 Swift 1.2 Xcode 6 Long-time listener, first-time caller. Hello, Straight from the horse's mouth: "To handle changes in iCloud availability, register to receive the NSUbiquityIdentityDidChangeNotification notification." Here is the code they provide to implement this: [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector (iCloudAccountAvailabilityChanged:) name: NSUbiquityIdentityDidChangeNotification object: nil]; I Swiftified it in my app to: var observer =

addSkipBackupAttributeToItemAtURL -> NSString parameter?

杀马特。学长 韩版系。学妹 提交于 2019-12-23 05:17:21
问题 In order to follow the Data Storage Guidelines I must use the below method to add a flag to say to not back it up to iCloud. However, the parameter here is for a NSURL. I need to pass it a NSString like from a line like so return [[self offlineQueuePath] stringByAppendingPathComponent:@"SHKOfflineQueue.plist"]; Here is the method that takes in a URL. - (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL { if (&NSURLIsExcludedFromBackupKey == nil) { // iOS <= 5.0.1 const char* filePath = [

Upload PHAsset from iCloud (i.e. which is not present on the local device )

此生再无相见时 提交于 2019-12-23 04:55:12
问题 I want to upload a PHAsset to the server. Now my PHAsset can be a photo or a video. I am able to do it successfully for the PHAssets present on the local device. But what if the PHAsset is not on the local device and instead present on the iCloud. Can we upload directly from the iCloud to the server or do we have to first download to the local device and then to upload operation to the server. Also, I would be grateful if someone could tell how to do this. Update: when we allow the network

Watchkit Extension Cannot Read from iCloud

人走茶凉 提交于 2019-12-23 03:37:06
问题 I am looking for the watchkit extension to read a file from iCloud document storage. I wrote the file from the iOS app which is also able to read it. I am leveraging a shared class so the code is the same. The problem is that on the watch, the URL for the cloud container returns nil. static func readFromFile(fileName:String) -> String? { let fileManager = FileManager.default var cloudURL = fileManager.url(forUbiquityContainerIdentifier: nil) cloudURL = cloudURL?.appendingPathComponent(

Problems with MPMediaQuery and iTunes Match

ε祈祈猫儿з 提交于 2019-12-23 00:30:48
问题 I need to display a list of all of the playlists currently on the device. The problem is, on a device with iTunes Match turned on, any number of playlists could have zero items saved on the phone. Since (as far as I can tell) there's no reliable way to trigger an MPMediaItem download when you're using AVAudioPlayer , I'd like to filter out any playlists that don't have any local entries. Right now I can have it cycle through an individual playlist and strip songs that don't have an assetURL ,

Problems with MPMediaQuery and iTunes Match

社会主义新天地 提交于 2019-12-23 00:29:02
问题 I need to display a list of all of the playlists currently on the device. The problem is, on a device with iTunes Match turned on, any number of playlists could have zero items saved on the phone. Since (as far as I can tell) there's no reliable way to trigger an MPMediaItem download when you're using AVAudioPlayer , I'd like to filter out any playlists that don't have any local entries. Right now I can have it cycle through an individual playlist and strip songs that don't have an assetURL ,

Remove Core Data from iCloud fails

风流意气都作罢 提交于 2019-12-22 13:56:22
问题 I'm trying to remove Core Data from iCloud using [NSPersistentStoreCoordinator removeUbiquitousContentAndPersistentStoreAtURL:options:error:] . But I get strange output: __93+[NSPersistentStoreCoordinator removeUbiquitousContentAndPersistentStoreAtURL:options:error:]_block_invoke(1982): CoreData: Ubiquity: Unable to move content directory to new location: file:///private/var/mobile/Library/Mobile%20Documents/<UBIQUITY_ID>/ New: file:///private/var/mobile/Library/Mobile%20Documents

App not appearing in iCloud “Manage Storage” list

五迷三道 提交于 2019-12-22 12:09:11
问题 My application was released and use iCloud but the App isn't appearing in the iCloud preferences (Settings.app > iCloud > Storage & Backup > Manage Store > Documents & Data) The sync is up and works great but I don't have access to the date of my app. 回答1: Apps will appear in iCloud "Manage Storage" list only when its iCloud container have a non-empty file. 来源: https://stackoverflow.com/questions/10487975/app-not-appearing-in-icloud-manage-storage-list