2

I have an iPad app that uses Ensembles; it uploads the CD to iCloud, but when I test it on a 2nd iPad, the app starts, but the sync'd data in iCloud is not downloaded (I can see the data in the 2nd iPad's iCloud Manage Data).

This is the log from Verbose logging:

2015-12-24 09:39:50.352 BookstoreInventoryManager[285:20376] [Crashlytics] Version 3.4.1 (92) 2015-12-24 09:39:50.546 BookstoreInventoryManager[285:20376]

ensembleStatus: 1 2015-12-24 09:39:51.219 BookstoreInventoryManager[285:20376] -[CDEICloudFileSystem repairEnsembleDirectory:completion:] line 176: Checking if repairs are needed in iCloud Drive 2015-12-24 09:39:51.274 BookstoreInventoryManager[285:20376] -[CDECloudManager retrieveRegistrationInfoForStoreWithIdentifier:completion:] line 724: Retrieving registration info 2015-12-24 09:39:51.315 BookstoreInventoryManager[285:20376] __77-[CDECloudManager retrieveRegistrationInfoForStoreWithIdentifier:completion:]_block_invoke_2 line 743: Downloading file at remote path: /BookInventoryMgr/stores/1778720D-A5E8-472E-8E62-CD9FE8C31D94-215-0000000391179BA0 2015-12-24 09:39:51.385 BookstoreInventoryManager[285:20376] -[CDECloudManager createRemoteDirectories:withCompletion:] line 688: Creating remote directories 2015-12-24 09:39:51.629 BookstoreInventoryManager[285:20376] -[CDECloudManager importNewDataFilesWithCompletion:] line 159: Transferring new data files from cloud to event store 2015-12-24 09:39:51.633 BookstoreInventoryManager[285:20376] -[CDECloudManager importNewBaselineEventsWithCompletion:] line 143: Transferring new baselines from cloud to event store 2015-12-24 09:39:51.659 BookstoreInventoryManager[285:20376] -[CDEBaselineConsolidator consolidateBaselineWithCompletion:] line 65: Consolidating baselines 2015-12-24 09:39:51.667 BookstoreInventoryManager[285:20451] __61-[CDEBaselineConsolidator consolidateBaselineWithCompletion:]_block_invoke line 76: Found baselines with unique ids: ( "092431DC-4576-4062-9A15-6B2ED4318BBA-215-00000003A933FF2D" ) 2015-12-24 09:39:51.677 BookstoreInventoryManager[285:20451] __61-[CDEBaselineConsolidator consolidateBaselineWithCompletion:]_block_invoke line 108: Baselines remaining that need merging: ( "092431DC-4576-4062-9A15-6B2ED4318BBA-215-00000003A933FF2D" ) 2015-12-24 09:39:51.679 BookstoreInventoryManager[285:20376] __61-[CDEBaselineConsolidator consolidateBaselineWithCompletion:]_block_invoke_2 line 131: Finishing baseline consolidation 2015-12-24 09:39:51.680 BookstoreInventoryManager[285:20376] -[CDECloudManager importNewRemoteNonBaselineEventsWithCompletion:] line 127: Transferring new events from cloud to event store 2015-12-24 09:39:51.771 BookstoreInventoryManager[285:20420] -[CDEEventIntegrator integrate:] line 311: Integrating new events into main context 2015-12-24 09:39:51.779 BookstoreInventoryManager[285:20420] __32-[CDEEventIntegrator integrate:]_block_invoke line 329: Baseline has changed. Will carry out full integration of the persistent store. 2015-12-24 09:39:51.813 BookstoreInventoryManager[285:20376] -[CDECloudManager exportDataFilesWithCompletion:] line 344: Transferring data files from event store to cloud 2015-12-24 09:39:51.821 BookstoreInventoryManager[285:20376] -[CDECloudManager exportNewLocalBaselineWithCompletion:] line 332: Transferring baseline from event store to cloud 2015-12-24 09:39:51.828 BookstoreInventoryManager[285:20376] -[CDECloudManager exportNewLocalNonBaselineEventsWithCompletion:] line 320: Transferring events from event store to cloud 2015-12-24 09:39:51.833 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 584: Removing outdated files 2015-12-24 09:39:51.836 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 603: Baseline files in cloud: {( "0_092431DC-4576-4062-9A15-6B2ED4318BBA-215-00000003A933FF2D_1778720D.cdeevent" )} 2015-12-24 09:39:51.836 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 604: Aliases for baseline files in store: {( "0_092431DC-4576-4062-9A15-6B2ED4318BBA-215-00000003A933FF2D.cdeevent", "0_092431DC-4576-4062-9A15-6B2ED4318BBA-215-00000003A933FF2D_1778720D.cdeevent" )} 2015-12-24 09:39:51.837 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 605: Baseline files to remove: {( )} 2015-12-24 09:39:51.839 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 612: Event files in cloud: {( )} 2015-12-24 09:39:51.839 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 613: Aliases for event files in store: {( )} 2015-12-24 09:39:51.839 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 614: Event files to remove: {( )} 2015-12-24 09:39:51.841 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 620: Data files in cloud: {( )} 2015-12-24 09:39:51.841 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 621: Data files in store: {( )} 2015-12-24 09:39:51.842 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 622: Data files to remove: {( )} 2015-12-24 09:39:51.842 BookstoreInventoryManager[285:20376] -[CDECloudManager removeOutdatedRemoteFilesWithCompletion:] line 635: Removing cloud files:

This all looks normal to me; The populated CD store doesn't appear to be on the 2nd device (I did a MR_findAll, but nothing was returned).

What do you suppose is wrong?

SpokaneDude
  • 4,856
  • 13
  • 64
  • 120
  • Some things in the log make me think you may be mixing versions of Ensembles on different devices. Do they all have the same version? Ensembles v1 and v2 don't mix. – Drew McCormack Dec 20 '15 at 10:34
  • Yes, they all have v1...I loaded the app from XCode... is there something else I need to add to the devices specifically? (Didn't see anything in the 'Book' regarding this). – SpokaneDude Dec 20 '15 at 15:07
  • Are you logged into the same iCloud account on both devices? – Drew McCormack Dec 22 '15 at 13:42
  • Yes... same id on both... I updated my avatar on my Mac and it's the same on both iPads... – SpokaneDude Dec 22 '15 at 14:29
  • In this Ensembles code: `- (void)contextDidSave:(NSNotification *)notif { NSManagedObjectContext *context = notif.object; if (!self.eventStore.containsEventData) return; if (context == self.eventIntegrator.managedObjectContext) return; // Check if this context includes the monitored store NSPersistentStore *monitoredStore = [self monitoredPersistentStoreInManagedObjectContext:context]; if (!monitoredStore) return; // <---- this statement IS executed` *context* is NOT a monitored store (I use *defaultContext* throughout my app). So, how do I fix this? – SpokaneDude Dec 24 '15 at 18:50
  • That is correct. Ensembles will only monitor a context that saves directly into the persistent store on disk. If you are using Magical Record, that is probably a background context. Note that such a background context may save at a later time. You have to make sure the background context is fully saved to disk when you quit or go to the background. – Drew McCormack Dec 26 '15 at 12:36
  • So, do I change all my references from "defaultContext" in my app to "context"? or should I make "context" the same as (equal to) "defaultContext" before I make any Ensembles calls? – SpokaneDude Dec 26 '15 at 14:43
  • Best to take a look at the MagicalRecord example app in the Ensembles source code. It shows how to handle the background context. In short, you need to merge changes into BOTH the contexts when merges happen. And it is best to force the background context to save going to the background, before you call processPending... on the Ensembles. – Drew McCormack Dec 27 '15 at 19:12

0 Answers0