Core-Data-Editor icon indicating copy to clipboard operation
Core-Data-Editor copied to clipboard

Cannot edit database

Open pawurb opened this issue 7 years ago • 9 comments

Hello. Probably I am doing something wrong but I cannot save changes to my database. Neither edit nor add new objects. I don't have any database validations in place. I am using a master branch build.

I managed to open my database and edit entry values. I cannot find the option to save the changes. After clicking File > Refresh state is reverted to the original one. Clicking File > Save only offers to create a new Core Data editor file. Is there any way to save the manually applied changes so that they will be reflected in my simulator app? Clicking the settings icon left of csv button raises the error mentioned in #45 . Maybe it is some system file access issue?

I will be grateful for any tips.

pawurb avatar Feb 07 '17 13:02 pawurb

Can you attach your model and sample store? If you don't want to attach it here you can send it to me privately: [email protected]

ChristianKienle avatar Feb 09 '17 08:02 ChristianKienle

I sent you an email with files you asked for. btw. I also get the following error:

CoreData: warning: Unable to load class named 'FocusSession' for entity 'FocusSession'.  Class not found, using default NSManagedObject instead.

I use Manual/None (then Editor > Create NSManagedObject Subclass) codegen option for my model class. Could it be the reason?

pawurb avatar Feb 10 '17 12:02 pawurb

Thanks for the files. The error message indicates that you are using custom managed object classes. When a model is loaded with NSManagedObjectModel and I start to create objects Core Data tries to create objects using your custom managed objects. Since Core Data Editor does not know your classes you normally would see this error. But Core Data Editor works around this problem by modifying a copy of your model and sets the classes of your entities to NSManagedObject. For some reason this did hot happen in your case... I will investigate.

ChristianKienle avatar Feb 12 '17 13:02 ChristianKienle

I was not able to fully reproduce your problem: Just like you i got the warning in the console but I was still able to edit and save. Can you please try again with the fix?

ChristianKienle avatar Feb 18 '17 14:02 ChristianKienle

Unfortunately still does not work. What action should save the changes ? Clicking the settings button keeps raising the same error.

pawurb avatar Feb 22 '17 12:02 pawurb

Can you make a short video using QuickTime? I think that would help...

ChristianKienle avatar Mar 12 '17 13:03 ChristianKienle

@ChristianKienle here you are https://www.dropbox.com/s/aiqu103k6xaqqh7/coredata.mov?dl=0

pawurb avatar Mar 13 '17 19:03 pawurb

@pawurb You have to press CMD-S or select Save from the file menu. This will save the CoreDataEditor project to a *.coredataeditor5 file && any changes made to your persistent store.

sptim avatar Mar 30 '17 23:03 sptim

Last year, I forked the project to add a Save Store Only feature:

save-store

You can find the code on my repo: https://github.com/tdimeco/Core-Data-Editor/commits/custom-build

Maybe it can be included in the project now?

– Thomas

tdimeco avatar May 10 '17 09:05 tdimeco