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

后端 未结 8 1471
粉色の甜心
粉色の甜心 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

    I've run into this problem in the last few days and strangely the solution that worked for me was a variant of that suggested above.

    I added the @objc declaration to the generated subclasses, but removed any namespace prefix in the class name in the object model (it had a default prefix of "PRODUCT_MODULE_NAME." after the subclasses were generated). That worked.

提交回复
热议问题