有没有好的 Core Data 浏览工具? [英] Is there a good Core Data browsing tool out there?

查看:24
本文介绍了有没有好的 Core Data 浏览工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从 SQLite 迁移到 Core Data 的过程中,我想念的一件事是能够直接查询我的数据库以分析数据.有没有人知道允许以类似方式浏览核心数据存储的工具?

One of the things I miss from moving from SQLite to Core Data is the ability to query directly against my database to analyze data. Is anyone out there aware of a tool that allows for the browsing of a Core Data store in a similar fashion?

推荐答案

CoreDataEditor 售价 20 美元,无法快速轻松地浏览托管对象上下文的关系.还有一些关于必须让 MOM 使用与您的应用程序完全相同的名称(??!)或类似名称的疯狂.我不会为了浏览我的对象存储而进入并开始重命名内容.不可否认,它确实有一个非常酷的应用程序图标,我从名称中推测您可以编辑内容.但是,就像原始海报一样,我只需要一些可以让我打开 Core Data 持久存储并快速了解托管对象的东西.

CoreDataEditor is $20 and doesn't make it quick and easy to browse the relationships of the managed object context. There was also some insanity about having to have the MOM use exactly the same name as your application (??!), or somesuch. I'm not about to go in and start renaming stuff just to browse my object store. Admittedly, it does have a pretty cool application icon, and I assume from the name that you can edit stuff. But, like the original poster, I just need something that will let me crack open a Core Data persistent store and quickly grok my managed objects.

我发现了一个更好的解决方案,它提供了对托管对象关系的直观和轻松浏览,而且是免费的,详细介绍如下:

I've found that a much better solution, one which offers intuitive and easy browsing of the relationships of managed objects, and which is free, is detailed here:

使用 F-Script 浏览核心数据数据库

您基本上安装了 F-Script,然后运行 ​​Mr. Tyson's Applescript,它会要求您定位您的 MOM(例如,YourApp.app),然后是用作持久存储的 SQLite 数据库(即,YourAppPersistentStore.sqlite).如果您使用的是 iPhone 模拟器,它们都在您的模拟器目录中——例如:

You basically install F-Script, and then run Mr. Tyson's Applescript, which asks you to locate your MOM (e.g., YourApp.app) and then the SQLite database that is being used as the persistent store (i.e., YourAppPersistentStore.sqlite). If you are using the iPhone Simulator, these are both in your Simulator directory -- for example:

/Users/me/Library/Application Support/iPhone Simulator/4.2/Applications/5452AC87-0426-4303-9402-C5F5900C7321/YourApp.app
/Users/me/Library/Application Support/iPhone Simulator/4.2/Applications/5452AC87-0426-4303-9402-C5F5900C7321/Documents/db/YourAppPersistentStore.sqlite 

然后选择一个实体并点击获取".你可以运行一个 NSPredicates 来过滤它的项目,或者点击一个项目并点击浏览".它打开F-Script 对象浏览器",从这个窗口,您可以跟踪关系并基本上浏览整个托管对象上下文中的所有项目,检查每个项目的所有属性.超级棒.

Then select an Entity and hit 'fetch'. You can run a NSPredicates to filter its items, or click on an item and click 'Browse'. It opens "F-Script Object Browser" and from this window, you can follow relationships and basically tour all the items in your entire managed object context, inspecting all the attributes for each item. It's super awesome.

这篇关于有没有好的 Core Data 浏览工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆