icloud

NSURLIsExcludedFromBackupKey crashes before iOS 5.1

孤者浪人 提交于 2019-12-05 14:24:26
Like many of iOS developers I have encountered the issue with application crashing on system before 5.1 when using NSURLIsExcludedFromBackupKey . It was well described how to evaluate existence of this key on this thread: Use NSURLIsExcludedFromBackupKey without crashing on iOS 5.0 One of samvermette's comments says that there is a bug in iOS simulator. Nevertheless I have encountered the same issue with a Release build, even in 2 separate applications. After some investigation I have discovered that application crashed even before main() method beeing called. Which hinted me that this is

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

有些话、适合烂在心里 提交于 2019-12-05 13:01:28
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. I was under the impression that iCloud Core Data syncing continued in the background, but I am having

改善文件管理性能(Improve Your File Management)

牧云@^-^@ 提交于 2019-12-05 12:35:31
最小化写入磁盘数据的数量。文件操作相对比较缓慢,包括写入有限寿命的闪存驱动器。 一些特定的提示帮助你减少与文件相关的操作: 写入文件改变的部分或所有的改变,避免因为几个字节写入整个文件。 当定义文件格式,频繁写入分组块的内容时,减少每次写入磁盘时块的总数。(原文:When defining your file format, group frequently modified content together to minimize the overall number of blocks that need to be written to disk each time.) 如果你的数据是由一组随机访问的结构化内容组成,那么使用Core Date持久化存储或者SQLite数据库,特别是如果你维护的数据可能增长超过几兆字节的情况。 避免写缓存文件到磁盘,唯一的例外是当应用程序退出时,你需要写入一些状态信息,用于app下次启动的时候恢复相同的状态。 App Backup Best Practices 你的应用程序不是必须要以任何方式进行备份恢复的操作。带有激活的iCloud账号的设备会在合适的时间备份他们的app数据到iCloud。对于插入电脑的设备而言,itunes执行增量备份app的数据文件。然而,iCloud和iTunes不备份的内容以下目录: < Application

Can developers use iCloud in Windows apps?

我怕爱的太早我们不能终老 提交于 2019-12-05 10:06:52
问题 Developers can use Apple’s iCloud APIs to sync app data between different versions of their app on Mac OS X and iOS. If a developer has a Windows version of their app, can this version also use iCloud to sync app data with versions of their app on Mac OS X and iOS? 回答1: Access to iCloud is controlled by Apple in such a way that each app that accesses it has to be signed and/or provided a key from Apple. That’s the easiest way to put it without violating the NDA, although the mechanism is not

NSMetadataQuery doesn't finish gathering (no notification)

房东的猫 提交于 2019-12-05 09:27:28
I'm making a backup managrer for my App (via iCloud). I did some tests and the basics worked. But few days later it stopped. I'm using NSMetadataQuery for searching if backup file exists. My backup files are named e.g. Backup29112011154133.xml where numbers represent date of the backup (formatted as ddMMyyyyHHmmss ). I check for it in -viewDidAppear : - (void)viewDidAppear:(BOOL)animated { [self checkForRemoteFile]; } - (void)checkForRemoteFile { NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; if (ubiq) { NSMetadataQuery *query = [[NSMetadataQuery alloc]

I'm not getting the NSPersistentStoreDidImportUbiquitousContentChangesNotification (with code sample)

自古美人都是妖i 提交于 2019-12-05 08:06:08
I'm trying to learn how to use iCloud with coredata. My target is to sync a single database file on mac/ios. Both my mac and iOS apps seem to be updating iCloud as I can see it under System Preferences->iCloud->Manage ... There's an app named Unknown which everytime I change something on the ios/mac app is getting bigger and bigger. So that makes me think The apps are storing changes to the cloud. The problem is, I'm not getting the NSPersistentStoreDidImportUbiquitousContentChangesNotification when i change something on the other platform. There's my code (mac app): - (void

CloudKit - How to share multiple records and retrieve shared records?

送分小仙女□ 提交于 2019-12-05 07:34:15
问题 I watched last WWDC 2016 What's New with CloudKit to understand how to share records with other users using CKShare Single record sharing: I am able to share and retrieve a single record i.e if xyz@gmail.com has created and shared a single record to abc@gmail.com Multiple records sharing: let's say there are 10 records and xyz@gmail.com wants to share to abc@gmail.com . I am facing the issue when user xyz@gmail.com shares multiple records to user abc@gmail.com What I have tried so far: First

Save game data into iCloud via GameKit

送分小仙女□ 提交于 2019-12-05 06:04:54
I'm trying to save game's data to iCloud via next code: GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; [localPlayer saveGameData:[NSData dataWithBytes:rawData->data() length:rawData->size()] withName:[NSString stringWithUTF8String:fileName.c_str()] completionHandler:^(GKSavedGame *savedGame, NSError *error) { if (error == nil) { DebugLog(@"Snapshot successfully saved"); } else { DebugLog(@"saveSnapshot error: %@", error.description); } }]; But getting error message: The requested operation could not be completed because you are not signed in to iCloud I've tried to do this in iOS

“Core Data with iCloud” vs “iCloud Core Data”

余生长醉 提交于 2019-12-05 06:01:50
问题 My question is: how do I find more information about "Core Data with iCloud" without finding too much "iCloud Cord Data"? These two things are named very similarly, which makes it very hard to find information about one without also finding the other. When I say "iCloud Core Data", I am referring to the functionality that has been recently deprecated in iOS10. "iCloud Core Data" involved Core Data stores with ubiquity options, which meant that individual records updates were synchronized

How to edit a NSManagedObjectModel that was loaded from a momd in iOS5

送分小仙女□ 提交于 2019-12-05 05:28:29
问题 For my iOS application using CoreData, I need to have a model where certain entities properties vary between the iPhone and iPad version of the app. To achieve this, I load a NSManagedObjectModel from a momd file located in my application bundle, using initWithContentsOfURL: . But, before the model is actually used by the storeCoordinator, I modify some entities programmatically in the model (based on information I store in a device specific plist). This used to work flawlessly on iOS4. As