Swift and CoreData Casting issues in test vs non-test

后端 未结 3 928
野的像风
野的像风 2020-12-31 19:39

I\'m using Swift on Xcode 6 with CoreData.

I\'ve read the release notes and have seen this issue about making sure to mark up a core data model with a m

3条回答
  •  庸人自扰
    2020-12-31 20:06

    You need to add one line to you Entity.swift file to make it also an Objective-C class like this:

    @objc(YourEntity)
    class YourEntity: NSManagedObject {
        ...
    }
    

    I think this as a bug if your project does not contains any objective-c code. However, you need to add that line until this fixed.

    I learned it from here.

    Youtube video at 11:45

提交回复
热议问题