drewmccormack / ensembles

A synchronization framework for Core Data.
MIT License
1.63k stars 131 forks source link

MagicalRecord issue #106

Closed walsht closed 10 years ago

walsht commented 10 years ago

I am trying to use MagicalRecord with ensembles and running into a error I can't get past.

Set up my stores like this...

[MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreNamed:databaseName];

Initalize ensemble

_ensemble = [[CDEPersistentStoreEnsemble alloc] initWithEnsembleIdentifier:@"MainStore" persistentStorePath:[NSPersistentStore MR_urlForStoreName:@"SwimBikeRunSpeeds.sqlite"].path managedObjectModelURL:modelURL cloudFileSystem:_cloudFileSystem];

when I call [[self ensemble] leechPersistentStoreWithCompletion:

I get this error:

Error Domain=NSCocoaErrorDomain Code=134130 "The operation couldn’t be completed. (Cocoa error 134130.)" ... }, reason=Can't find model for source store}

Any help resolving this would be appreciated.

Thanks, Tim

drewmccormack commented 10 years ago

What is the modelURL? Is that the URL for your store's model momd file? How have you linked to Ensembles? Have you included the file CDEEventStoreModel.xcdatamodeld as a resource in your project? You need to do that.

MetaImi commented 9 years ago

I had the same issue. It was that I did not turn off the shouldAutoCreateManagedObjectModel in magical records. Took me 2 hours to figure it out, but it was in the example code :) At least I had a chance to have a closer look on the framework.

drewmccormack commented 9 years ago

The book covers this in the Quick Start guide under "Using Ensembles with Magical Record" too.

MetaImi commented 9 years ago

But if you are too eager to start using it, you might skip some lines of the simple code :) :) Anyway, it turned out I can't use it in my own project :(

drewmccormack commented 9 years ago

Any particular reason you couldn't use it? Just interested.

MetaImi commented 9 years ago

I have a large dataset (> 30k entries from the past 2.5 months ). I have integrated your great framework, but

I know these issues might caused by me, but I have developed this app for almost 3 months, and I'm about to release it soon, so I don't want to spend more time on this until I do not get the first feedbacks. Anyway, it works so I will continue to investigate it in the future.

Btw, I can not get the demo app (download form AppStore) working with iCloud @ iOS 8 (iPad 3rd, iPhone 5). Dropbox sync is working, but not iCloud.

drewmccormack commented 9 years ago

I see. Yes, that is quite a bit of data. You will probably have to work hard to make it work OK with whatever sync you decide to use.

Some things that might help:

  1. If you adopt Ensembles 2, it uses less memory, and allows you to process data in batches to keep memory low.
  2. The initial leech does import the whole local store, so it could take a while for a large amount of data. Something that has just been added in Ensembles 2 is the option to not import local data, which makes it very fast. If you use this, you assume all the data is in the cloud, and don't do any merging of data.

I will investigate the iCloud issue in Idiomatic. Thanks for pointing it out.

Drew