icloud

What is the best way to remove logs file Core Data creates, when removing a UIManagedDocument from iCloud?

夙愿已清 提交于 2019-12-02 20:02:57
问题 I would have thought NSFileManager s method of removeItemAtURL:error: would remove the Core Data log files created when using UIManagedDocuments with iCloud. What is the best way to make sure all of these log files are removed? 回答1: I have used... - (void)deleteRemnantsOfOldDatabaseDocumentAndItsTransactionLogsWithCompletionHandler:(completion_success_t)completionBlock { __weak CloudController *weakSelf = self; NSURL *databaseStoreFolder = self.iCloudDatabaseStoreFolderURL; NSURL

CloudKit share Data between different iCloud accounts but not with everyone

僤鯓⒐⒋嵵緔 提交于 2019-12-02 18:37:32
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 the same for everyone. In that Record Type there is a Field of type String that is also the same for

Using the UIDocumentPickerViewController, is it possible to show a default service (Dropbox, Google Drive, etc) on first open like in Slack?

不问归期 提交于 2019-12-02 18:10:17
Normally, the behavior with UIDocumentPicker is that you present, then the user must use the "Locations" menu on the top right to switch between the services. Is it possible to display either "Dropbox" or "Google Drive" first by default? Almost as if we're "deeplinking" into the UIDocumentPicker service. It seems like Slack App is able to do this and also the MyMail App but I wasn't able to find an API for it. Any ideas? Instead of using a UIDocumentPickerViewController, try using a UIDocumentMenuViewController. Here is the relevant documentation . UIDocumentMenuViewController

How to check if iCloud is configured programmatically

烂漫一生 提交于 2019-12-02 17:33:09
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? nacho4d 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 which was meant for people targeting iOS5 and above Original Answer As documented in iOS App

Move local Core Data to iCloud

早过忘川 提交于 2019-12-02 14:44:47
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's how I'm using the method: - (void)migratePersistentStoreWithOptions:(NSDictionary *)options {

Migrate Persistant Store Crash

一个人想着一个人 提交于 2019-12-02 07:04:24
问题 I have a switch that turns iCloud on or off for an iOS 7 app. iCloud sync works fine. When iCloud is on and I turn it off, I call this code: - (void)migrateiCloudStoreToLocalStore { NSError *error; __weak NSPersistentStoreCoordinator *psc = self.managedObjectContext.persistentStoreCoordinator; NSDictionary *options = @{NSMigratePersistentStoresAutomaticallyOption:@YES, NSPersistentStoreRemoveUbiquitousMetadataOption : @YES}; NSPersistentStore *currentStore = [psc persistentStores][0]; NSLog(@

CREATE operation not permitted

时光毁灭记忆、已成空白 提交于 2019-12-02 06:50:26
I am trying to utilize CloudKit in my iOS application, but when I attempt to create a new record for for a User record type (record type is named Users ), I get this error: <CKError 0x7fb80947ffb0: "Permission Failure" (10/2007); server message = "CREATE operation not permitted"; uuid = 8C4C7B60-E3F4-42FC-9551-D3A76A6FF9D6; container ID = "iCloud.com.jojodmo.Blix"> To create the new record, I am using this code in viewDidLoad() : UserCKManager.create( CloudKitUser( email: "email@website.com", password: "password", salt: "1AF4E759B20FEC32", username: "jojodmo", posts: [], biography: "This is my

iphone iCloud app crashes when compiling on iOS 4

痴心易碎 提交于 2019-12-02 06:30:31
I'd like to use an iCloud, but when I compile the app on iOS 4.3 Simulator it crashes. dyld: Symbol not found: _OBJC_CLASS_$_NSMetadataQuery What should I do to make it working on iOS 3, 4, and 5? These API has been launched with the ios5 so you cann't run it on the simulator 4 or below but for posting you can set the minimum deployment target of ios family it should support . my sulotion is: Where have NSMetadataQuery change to id: ex normal : - (void)loadData:(NSMetadataQuery *)query; change to: - (void)loadData:(id)query; normal: @property (retain, nonatomic) NSMetadataQuery *query; change

Migrate Persistant Store Crash

本小妞迷上赌 提交于 2019-12-02 06:21:34
I have a switch that turns iCloud on or off for an iOS 7 app. iCloud sync works fine. When iCloud is on and I turn it off, I call this code: - (void)migrateiCloudStoreToLocalStore { NSError *error; __weak NSPersistentStoreCoordinator *psc = self.managedObjectContext.persistentStoreCoordinator; NSDictionary *options = @{NSMigratePersistentStoresAutomaticallyOption:@YES, NSPersistentStoreRemoveUbiquitousMetadataOption : @YES}; NSPersistentStore *currentStore = [psc persistentStores][0]; NSLog(@"iCloud Store - %@", currentStore); NSLog(@"Local Store - %@", self.store); [psc migratePersistentStore

Excluding files from iCloud backup

我怕爱的太早我们不能终老 提交于 2019-12-02 03:20:39
问题 I'm using iOS 5.1 I use this peace of code [pathURL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:nil]; The folder where I put my content is (inside app sandbox) .../Library/Application Support/, not a /Documents folder I do not receive any errors and the result of setResourceValue: is YES Why do I see 2 MB is Settings -> iCloud -> ... etc. where I can check the apps data size? 回答1: Finally I found the solution by myself The clue is to apply