Mini-Stef / Core-Data-Model-Editor

The place to get help, report problems or request feature on the Core Data Model Editor app.
https://github.com/Mini-Stef/Core-Data-Model-Editor
10 stars 1 forks source link

Constraints in the model file are not preserved #3

Closed vdhamer closed 10 months ago

vdhamer commented 10 months ago

If you load an xcdatamodel file (set), the XML fields about uniqueness constraints are not visible in the app. Worse, they are not stored if you Save an updated version of the file.

Steps to reproduce the behavior:

  1. Create a simple model using Xcode
  2. Add a constraint (e.g. Name or UUID is unique)
  3. Save model in Xcode (happens automatically, Ctrl-S to be sure)
  4. Load model in app
  5. Save model in app
  6. Load version saved by app in Xcode

Expected: constraint is still there in xcode. Result: constraint is gone.

Mini-Stef commented 10 months ago

Hello vdhamer, Thanks for using the app, and thanks for detecting this. I'll give it a look this week end.

Mini-Stef commented 10 months ago

OK, I found out the root cause. I can do a quick (but clean) fix where constraints would be preserved, but you can't actually manage them in the app. And a longer term fix where you would manage the constraints in the app. Is that OK for you ?

vdhamer commented 10 months ago

Preserving the constraints is fine. It allows a user to switch from Xcode as editor to your app as editor (when the constraints already exist).

Once the file contains a constraint, it can always be edited at the ASCII / XML level.

So I have no urgent need to edit constraints via the UI. Just need to avoid data loss when switching between both editors.

Will mention that this will be solved in the review for the AppStore. Thank you.

Sent from my iPad

On 12 Jan 2024, at 18:54, Mini-Stef @.***> wrote:



OK, I found out the root cause. I can do a quick (but clean) fix where constraints would be preserved, but you can't actually manage them in the app. And a longer term fix where you would manage the constraints in the app. Is that OK for you ?

— Reply to this email directly, view it on GitHubhttps://github.com/Mini-Stef/Core-Data-Model-Editor/issues/3#issuecomment-1889723717, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADGGUWBT63J6ZEKDM3DMW7LYOF2FJAVCNFSM6AAAAABBYBEKBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBZG4ZDGNZRG4. You are receiving this because you authored the thread.Message ID: @.***>