How come I can cast to NSManagedObject but not to my entity's type?

后端 未结 8 1481
粉色の甜心
粉色の甜心 2020-12-01 13:36

I\'m using the Swift boilerplate code for Core Data in a fresh project. My .xcdatamodeld file has a single entity defined (Task) with a single attr

8条回答
  •  不知归路
    2020-12-01 14:13

    This is even frustrated if you tried all the above suggestions and non of them working for me!!

    So this is what works for me.

    1- Select your xcdatamodeld file

    2- Make sure that all your entities has No Module in the "Data Model Inspector", if you see "Model: Current Product Module" ..clear it it so it looks like the attached image.

    3- Delete your App to clear core data

    4- If still not working, delete your entities and regenerate them.

提交回复
热议问题