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

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

问题描述

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

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应用程序中使用此参数,以防万一MY程序中有其他问题。

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.

即使在苹果的例子中,控制台中也没有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?

更新:苹果已经修复了新版本的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(最终)似乎不一致。

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天全站免登陆