为什么Xcode说“找不到类型' nspersistentContainer'在“范围”中?

发布于 2025-01-22 19:57:27 字数 212 浏览 1 评论 0原文

我只是凝视着一个新的核心数据项目,但没有进行任何更改,我会遇到此错误。不知道为什么。

I just stared making a new Core Data project but without making any changes yet, I am getting this error. Not sure why.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜味拾荒者 2025-01-29 19:57:27

您已经命名了您的应用程序“ Coredata”,因此覆盖了框架的名称coredata,因此编译器所抱怨的是您的您的应用程序没有类型nspersistentContainer

另外,您对导入语句(导入coredata)有警告,暗示某些问题是错误的

解决方案:删除项目并创建一个具有更独特名称的新项目,甚至mycoredapp会做。

You have named your application "CoreData" thus overwriting the name of the framework CoreData so what the compiler is complaining about is that your app doesn't have a type NSPersistentContainer.

Also, you have a warning on the import statement (import CoreData) that hints that something is wrong

Solution: Delete the project and create a new one with a more unique name, even something like MyCoreDataApp will do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文