Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SeamStoreType undeclared identifier #21

Open
koenvanderdrift opened this issue Sep 12, 2015 · 12 comments
Open

SeamStoreType undeclared identifier #21

koenvanderdrift opened this issue Sep 12, 2015 · 12 comments

Comments

@koenvanderdrift
Copy link

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?

@nofelmahmood
Copy link
Owner

You can also try SMStore.type instead of SeamStoreType.

@koenvanderdrift
Copy link
Author

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).

@nofelmahmood
Copy link
Owner

Delete the app from the simulator/device and rebuild/reinstall it again.

@koenvanderdrift
Copy link
Author

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.

@nofelmahmood
Copy link
Owner

Let me investigate this :)

@nofelmahmood nofelmahmood reopened this Sep 12, 2015
@koenvanderdrift
Copy link
Author

Just to clarify, I'm trying to add CloudKit to an existing app that already uses CoreData.

@PenguinGeorge
Copy link

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! 😄

@chbeer
Copy link

chbeer commented Sep 13, 2015

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 notifications@github.com:

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.

@chbeer
Copy link

chbeer commented Sep 16, 2015

One cause could be the modification of the model by SMStoreChangeSetHandler.modelForLocalStore

@nofelmahmood
Copy link
Owner

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 :)

@PenguinGeorge
Copy link

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.

@koenvanderdrift
Copy link
Author

@nofelmahmood Have you been able to make any progress with this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants