如何获取 CoreData Debug 参数以输出到控制台? [英] How do I get the CoreData Debug argument to output to the console?

查看:29
本文介绍了如何获取 CoreData Debug 参数以输出到控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 Apple 关于调试核心数据的文档 它说我们应该能够将一个参数传递给应用程序,该应用程序将输出发送到 SQLite 的 SQL 核心数据.

According to Apple documentation on debugging Core Data it says we should be able to pass an argument to the application which will output the SQL core data sends to SQLite.

我已经进入了 XCode 中可执行文件的参数选项卡并指定了参数:

I have gone into the arguments tab of my executable in XCode and specified the arguments:

-com.apple.CoreData.SQLDebug 1

但是,我在控制台中没有看到 SQL.然后我尝试在 Apple 提供的 CoreDataBooks 应用程序中使用此参数,以防万一我的程序中出现其他问题.

However, I see no SQL in the console. I then tried to use this parameter in the CoreDataBooks application provided by Apple just in case there was some other issue in MY program.

即使在 Apple 的示例中,我也没有在控制台中获得 SQL 输出.

Even in Apple's example I get no SQL output in the console.

我做错了吗?苹果的文档有错吗?我应该寻找控制台以外的地方吗?有没有其他人在这个论点上取得成功?

Am I doing something wrong? Is Apple's documentation wrong? Should I be looking someplace other than the console? Has anyone else had success with this argument?

更新: Apple 已经通过更新的 XCode 版本修复了输出错误;但是,要明确最终解决方案:

UPDATE: Apple has since fixed the output bug with newer releases of XCode; however, to be clear on the final solution:

参数是两个单独的参数,因此应在参数选项卡中输入.-com.apple.CoreData.SQLDebug 是一个参数,值 1 是第二个参数.

推荐答案

XCode 4 (final) 似乎不一致.

XCode 4 (final) seems to be inconsistent.

使用一个参数在设备上有效,但在模拟器中失败:

Using one argument works on the device, but fails in the simulator:

-com.apple.CoreData.SQLDebug 1

使用两个参数适用于设备和模拟器:

Using two arguments works on the device and in the simulator:

-com.apple.CoreData.SQLDebug

1

这篇关于如何获取 CoreData Debug 参数以输出到控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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