Issues with the Xcode data model appearing in the editor

Can anyone help? Because it drives me crazy!

I have an application that I am in the early stages and it has a data model. So far, he has only 5 entities and several relationships.

So far, I have not used version control, simply removing the application from my iPad and reloading it when I make changes to the layout. So far, this has worked fine since I changed the circuit several times.

This morning I tried to add a new entity with a relationship to an existing entity in the model. Everything seemed beautiful until I returned to inspect the model. The graphic representation is all sluggish. There are no relationships, arrows indicate empty space, and the layout is not the way I saved it ...

Deleting a new object restores everything in order. Or appears.

I can add an entity without problems, but as soon as I try to add a relationship, this is messed up. I think the model itself is fine, just the graphical representation is disabled.

I tried to create a new version, setting its current, editing it and the same result every time ... I do not see anything to solve it.

This is my first experience using basic data, so maybe it’s something dumb on my part, but I'm sure I’m doing the same thing as for the other 4 entities.

Help me please!

+6
source share
1 answer

Here's a little hack to fix this display error in Xcode, which usually happens due to corrupted data in YourApp/YourApp.xcdatamodeld/YourApp.xcdatamodel/layout .

After exiting Xcode or closing the project, you can simply delete this file (it did not always work for me, sometimes the file does not exist).

Alternatively, you can edit the contents file in the same directory and simply delete the entire section labeled <elements> .... </elements> . All your entities will be on each other in the editor, but now they should work after their regrouping.

+20
source

Source: https://habr.com/ru/post/912482/


All Articles