Seam
Seam copied to clipboard
SeamStoreType undeclared identifier
I have added Seam to my ObjectiveC project using CocoaPods, and successfully declared a property for the store:
@property (nonatomic, readonly) SMStore *seamStore;
I then use the following code to add it to my NSPersistentStoreCoordinator
:
_store = [_coordinator addPersistentStoreWithType: SeamStoreType configuration: nil URL: storeURL options: options error: &error];
Which gives me an undeclared identifier
error for SeamStoreType
.
What do I need to do for my code to recognize SeamStoreType
?
You can also try SMStore.type instead of SeamStoreType.
Thanks that works.
But I now get the following error when my app starts:
2015-09-12 05:31:09.413 MyApp[1370:294516] CoreData: error: -addPersistentStoreWithType:Seam.SMStore configuration:(null) URL:file:///var/mobile/Containers/Data/Application/840EABA8-B794-4D9B-8ED5-DC9BA079B8E5/Documents/Stores/MyApp.sqlite options:{ NSInferMappingModelAutomaticallyOption = 1; NSMigratePersistentStoresAutomaticallyOption = 1; NSSQLitePragmasOption = { "journal_mode" = DELETE; }; } ... returned error Error Domain=Seam.SMStoreError Code=2 "The operation couldn’t be completed. (Seam.SMStoreError error 2.)" with userInfo dictionary { }
And
reason = "The model used to open the store is incompatible with the one used to create the store";
Any idea what could be causing this ?
(Sorry, I'm new to Swift).
Delete the app from the simulator/device and rebuild/reinstall it again.
That gives the same error. ~~Seems to be a migration error caused by adding a persistentStore (my model didn't change), so I don't know if it is a Seam issue.~~
Let me investigate this :)
Just to clarify, I'm trying to add CloudKit to an existing app that already uses CoreData.
I'm also getting this problem in my project. CoreData is already in use, and no changes to the model have been made. Hopefully this can be fixed! :smile:
I implemented a NSIncrementalStore for CouchDB and had similar problems. It's about NSStoreUUIDKey. I think the store needs to handle/store it and not take it from the underlying persistent store.
I can look up more details tomorrow, if you like.
Am 13.09.2015 um 21:17 schrieb George Jones [email protected]:
I'm also getting this problem in my project. CoreData is already in use, and no changes to the model have been made. Hopefully this can be fixed!
— Reply to this email directly or view it on GitHub.
One cause could be the modification of the model by SMStoreChangeSetHandler.modelForLocalStore
I am really really sorry @chbeer @koenvanderdrift @PenguinGeorge for not being able to do something about it at the moment. But I did check and I didn't face this particular error, all was working fine for me. But still I am committed to something really important for the next few days. Once I am done with it my next priority would be looking into it in more depth. @chbeer Seam modifies the model to add some entities and attributes which are used to keep track of local changes. It then uses this model to create a SQLiteStoreType. This may help :)
Not a problem for me at the moment, as I'm adding it in to an update which is a few weeks away yet. :) Looking forward to a fix though.
@nofelmahmood Have you been able to make any progress with this issue?