我可以从 Xcode 检查 Core Data 模型吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5938809/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:00:20  来源:igfitidea点击:

Can I inspect a Core Data model from Xcode?

xcodexcode4

提问by aneuryzm

Can I inspect a Core Data model from Xcode?

我可以从 Xcode 检查 Core Data 模型吗?

I want to see if the data are correctly stored into the database.

我想看看数据是否正确存储到数据库中。

采纳答案by Joshua Nozzi

There's no direct "show me some data stored at some path I specified somewhere in my code or at runtime that happens to use this model" feature.

没有直接的“向我展示存储在我在代码中指定的某个路径或在运行时恰好使用此模型的某些路径中的一些数据”功能。

If you want to view a file easily in Xcode, you'll need to add the file to your project (don't let it copy into project - just reference it in place) so you can select it in the navigator.

如果您想在 Xcode 中轻松查看文件,您需要将文件添加到您的项目中(不要让它复制到项目中 - 只需在适当的位置引用它),以便您可以在导航器中选择它。

Caveat: This only works for text-based store types (like XML or some custom text-based store type you cooked up). If you use binary or SQLite store types, all you'll see is binary. There's no SQLite database browsing/editing functions in Xcode.

警告:这仅适用于基于文本的存储类型(例如 XML 或您编写的一些自定义的基于文本的存储类型)。如果您使用二进制或 SQLite 存储类型,您将看到的只是二进制。Xcode 中没有 SQLite 数据库浏览/编辑功能。

回答by Pixman

You can use this tool http://christian-kienle.de/CoreDataEditor

你可以使用这个工具http://christian-kienle.de/CoreDataEditor

You can inspect all datas from your persistent store

您可以检查持久存储中的所有数据

回答by learner2010

I have not come across a way to check the Core Data Modal directly from Xcode... right now I use "SQlite Database Browser" to check my database... its a good way to check your data in the database.. you can also execute queries on it...

我还没有遇到直接从 Xcode 检查核心数据模式的方法......现在我使用“SQlite 数据库浏览器”来检查我的数据库......这是检查数据库中数据的好方法......你可以还对其执行查询...

P.S. If you do come across a way to check the Core Data Modal directly from Xcode, please do post it as an answer here...

PS如果您确实遇到了直接从Xcode检查核心数据模态的方法,请在此处将其作为答案发布...