Xcode 11无法识别核心数据实体 [英] Xcode 11 doesn't recognize Core data Entity
问题描述
我刚刚声明了一个称为用户数组的实体:
I just declared an entity called "Users" array:
var UsersArray = [Users]()
我遇到此错误:
使用未解析的标识符 Users
use of unresolved identifiers "Users"
提示:我确实导入了CoreData并创建了实体
hint : I did import CoreData and created the entity
推荐答案
请尝试以下解决方案!
解决方案1:-
Product->可以通过测试为我解决此问题(由于某种奇怪的原因,它解决了大多数未解决的标识符错误)
Solution 1 :- Product->Buld for testing solved this issue for me(it solves most unresolved identifier bugs for some strange reason)
解决方案2:-
更改import Foundation以导入UIKit。
似乎UIApplication不包含在Foundation框架中。
Solution 2 :- changing import Foundation to import UIKit. It seems like UIApplication isn't included in Foundation framework.
解决方案3 :-突出显示数据模型,转到编辑器->创建NSManagedObject子类...
Solution 3 :- Highlight the Data Model, go to Editor -> Create NSManagedObject Subclass...
希望这可以帮助您。
这篇关于Xcode 11无法识别核心数据实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!