CoreData unique constraints disappears in Xcode

前端 未结 1 1393
逝去的感伤
逝去的感伤 2021-01-27 02:31

What I want to do:

Add a unique constraint on the attribute photoID in the entity PhotoUpload.

Problem:

I tap on constraints a

相关标签:
1条回答
  • 2021-01-27 03:10

    I believe this to be a bug in Xcode. If you change the model to add (or amend or remove) a constraint, the underlying model file is not updated, even though the screen shows the changes correctly. To overcome it, change another element of the model at the same time as adding the uniqueness constraint. Save the model. Then change the other element back and save again.

    0 讨论(0)
提交回复
热议问题