icloud

UIManagedDocument migrate data model

北战南征 提交于 2019-12-06 04:39:22
问题 I am working on an iPhone app that uses a subclass of UIManagedDocument and stores its documents on iCloud. It was all working fine until I changed my core data model / scheme (adding a new model version - like I had several times in the past few weeks). I added a new property and changed the data type of one of the existing properties. Now when I run my app I don't seem to be able to load my documents with UIManagedDocument 's -openWithCompletionHandler: . I can create new documents and read

iCloud's loadFromContents - how to deal with UIDocumentStateSavingError & UIDocumentStateEditingDisabled

时光毁灭记忆、已成空白 提交于 2019-12-06 03:13:06
问题 I'm using iCloud in my app to load text files. When loading text files, this method is called by iCloud when I call _UIDocument openWithCompletionHandler:^(BOOL success) etc: -(BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName error:(NSError **)outError { NSLog(@"Library loadFromContents: state = %d", self.documentState); if (!_books) { _books = [[NSMutableArray alloc] init]; } //if (self.documentState > 7) { // NSLog(@"document is either savingError (4), EditingDisabled (8) or

How to prompt for CKApplicationPermissionUserDiscoverability again

守給你的承諾、 提交于 2019-12-06 02:06:05
Is there a way to get iOS to prompt for CKApplicationPermissionUserDiscoverability again after the user has declined it? The most I've been able to do is remove permission in the iCloud settings pane in OS X, which just returns a deny to the iOS app without any user interaction. The app I'm writing is useless without discoverability, so I want to be able to prompt again if the user initially says no. On the iCloud settings of the iOS 8.1, under the iCloud Drive, there is an option called "Look Me Up By Email". There you will be able to reset the permission. In iCloud dashboard, under

iCloud Key-Value-Store Synchronization issues (NSUbiquitousKeyValueStoreDidChangeExternallyNotification not called)

拜拜、爱过 提交于 2019-12-05 23:37:34
问题 i am writing a small universal game for iOS. the highscore will be synched accross devices through an iCloud Key/Value store. getting the newest score: func retrieveHighestScore() -> Int64 { let iCloudScore: Int64 = NSUbiquitousKeyValueStore.defaultStore().longLongForKey(KeyValueKeyClassification.KeyHighscore.toRaw()) let localScore: Int64 = Int64(NSUserDefaults.standardUserDefaults().integerForKey(KeyValueKeyClassification.KeyHighscore.toRaw())) var result: Int64 = 0 if localScore >

Core data/iCloud seeding with local xml file throwing errors in iOS8

微笑、不失礼 提交于 2019-12-05 22:08:55
问题 Hopefully this is something simple but I haven't been able to track down a fix yet. I have an application that I'm trying to implement both iCloud and Core Data with. I'd like it to run on iOS7 and iOS8. The application is a checklist/tableview application for collectibles. Essentially, the application has an pre-seeded xml file with about 50,000 in it. The sqlite/core data is initially configured to have just 1 item. Users can, from a table view, select groups to add to the core data store

What's the use of iCloud Display Sets?

為{幸葍}努か 提交于 2019-12-05 21:18:42
问题 When adding iCloud support to iOS app one can configure iCloud Display Set and link it with an app by specifying NSUbiquitousDisplaySet . But iCloud works even without it, so my question is: what's the purpose of iCloud Display Sets at all? Couldn't find any clear answer anywhere in the docs. And what's more, based on the Apple docs it seems as if specifying Display Set for your app was mandatory if you use iCloud. That did confuse me a bit. It is so that one might want to share the same

iOS Application freezing on first launch when iCloud is enabled

北城余情 提交于 2019-12-05 20:55:35
I enabled iCloud in my iOS app and on first launch of the app the app freezes for about 5 seconds when i press on any view in the app. I followed this tutorial to enable iCloud in my app and synchronize data using core data. I did not have this problem before adding iCloud synchronization. This only happens on first launch, not on other launches of the app. iCloud synchronization does occur. The problem is the app freezing. Here is the code that manages the synchronization in my app delegate. - (NSURL *)applicationDocumentsDirectory { return [[[NSFileManager defaultManager] URLsForDirectory

“Error: this process has called an NSArray-taking method…” when iCloud pushes managed objects

无人久伴 提交于 2019-12-05 18:35:05
For every managed object that is sent via iCloud update, this warning/error is sent to the console: *** ERROR: this process has called an NSArray-taking method, such as initWithArray:, and passed in an NSSet object. This is being worked-around for now, but will soon cause you grief. My managed objects are Clients and have a one to many relationship with assessments as shown below. class Client: NSManagedObject { //other NSManaged vars are here @NSManaged var assessment: NSOrderedSet } Judging by the timing of this error (during ubiquitous updates) and the fact that this is my only use of NSSet

NSURLThumbnailDictionaryKey empty for local file

怎甘沉沦 提交于 2019-12-05 17:39:54
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 with a NSURL pointing to a local file, however, the thumbnails dictionary is empty. Here is an example of

iCloud ubiquity containers not being cleaned up on app delete?

故事扮演 提交于 2019-12-05 16:49:17
问题 I am adding iCloud with Core Data to an app that already exists in the app store, so I need to test upgrade scenarios. However, when I delete my app from my device and re-install it from Xcode, I have noticed that everything inside of my ubiquity container folder on the device is persisted! This is incredibly annoying, as iCloud ends up getting confused when trying to upload files from the transaction logs directory I have specified and often times out. I end up needing to specify a new