icloud

UIManagedDocument + iCloud “Big Picture”?

天涯浪子 提交于 2019-12-04 10:25:59
I am working on my first "iCloud App". I worked through the Apple docs and the Stanford videos but I am still struggling to understand the "Big picture" of iCloud. My goal is to create a " Library style " app (which is Apples term for an app with "a single Core Data stack with a single persistent store coordinator and a single persistent store") like the Employees example . Following the Stanford videos I am using a UIMangedDocument to setup all Core Data stuff and enable the iCloud capabilities. The UIMangedDocument contains the Database and is "stored in the cloud". This is already the first

Syncing a .plist file with iCloud

只愿长相守 提交于 2019-12-04 10:18:17
I am trying to work out how to sync a .plist file I have in the "Application Support" folder in my Sandboxed app for the Mac. I know I could use the iCloud key value store, but there is a limit of 64KB per app, which may or may not be hit depending on how many thing the user adds to the app! I have read as much of the Apple documentation as possible, but I am still rather confused :( Has anyone does something similar to this? Thanks You should create a subclass of UIDocument and use it with ubiquity directories. There are 2 methods responsible for handling read/write. This one is called when

Migrating an iCloud Store to a Local Store and making sure the data is there through each app launch

青春壹個敷衍的年華 提交于 2019-12-04 09:38:14
Based on the question here: Migrate iCloud data to Local store and stopping iCloud from still responding regard moving an iCloud store over to a local store and making sure the iCloud notifications are disabled, I have the next scenario that I am stuck on. Issue Right now, when the user runs the app on the first device, they're asked at the start if they want to enable iCloud. If they select yes, the data is migrated over to iCloud. If the user connects in a second device, they're asked if they want to use iCloud at the start and if they select yes, data from the first device is synchronised

Check given PHAsset is iCloud asset?

江枫思渺然 提交于 2019-12-04 09:28:54
问题 I'm trying to get PhAsset object. I want to segregate iCloud assets. Here is my code, PHFetchResult *cloudAlbums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeAlbum subtype:PHAssetCollectionSubtypeAny options:nil]; [cloudAlbums enumerateObjectsUsingBlock:^(PHAssetCollection *collection, NSUInteger idx, BOOL *stop){ if(collection != nil){ PHFetchResult *result = [PHAsset fetchAssetsInAssetCollection:collection options:fetchOptions]; [result enumerateObjectsUsingBlock:

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

耗尽温柔 提交于 2019-12-04 08:56:03
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. The name of the NSNotification I have to listen for is NSMetadataQueryDidUpdateNotification . This is how I did it: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(queryDidUpdate:) name

iCloud Integration for uploading and downloading files

喜你入骨 提交于 2019-12-04 08:39:01
问题 I want to design an app which stores documents on iCloud . But there are some question which has answer before doing actual implementation. The question are as follows, What is maximum file size to upload on iCloud? Can I programmatically calculate/know the available space on user's iCloud account? How can I get the event for uploading and Downloading files from iCloud? Can anyone please help me here ? I read the apple documentation but not understood all the things completely. Thanks In

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

白昼怎懂夜的黑 提交于 2019-12-04 07:43:46
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 both (12)... will not load"); // return NO; //} self.books = [NSKeyedUnarchiver unarchiveObjectWithData

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

随声附和 提交于 2019-12-04 06:05:36
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 > iCloudScore { storeNewHighscore(localScore) result = localScore } else { storeNewHighscore(iCloudScore) result

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

夙愿已清 提交于 2019-12-04 06:04:42
Is there a way to see what my app is backing up to iCloud, and how much memory it consumes? 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. If you just want to see, you can go into Settings->iCloud->Storage & Backup->Manage Storage. On your Mac, you can browse to " ~/Library/Mobile Documents " and see what is being stored in

iphone iCloud app crashes when compiling on iOS 4

风流意气都作罢 提交于 2019-12-04 05:36:33
问题 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? 回答1: 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 . 回答2: my sulotion is: Where have NSMetadataQuery change to id: ex normal : - (void)loadData:(NSMetadataQuery *