XCode4和Core Data:如何启用SQL调试 [英] XCode4 and Core Data: How to enable SQL Debugging

查看:132
本文介绍了XCode4和Core Data:如何启用SQL调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个通用的iOS应用程序,我想在调试时看到日志中的原始SQL。有一些信息在此博文中了解如何为iOS Core启用原始SQL日志记录数据开发。给定的例子是XCode 3,它只是不清楚我如何在XCode 4中启用这个。

I'm working on a universal iOS app and I'd like to see the raw SQL in the logs when I'm debugging. There is some info in this blog post about how to enable raw SQL logging for iOS Core Data development. The given example is for XCode 3 and it's just not clear to me how to enable this in XCode 4.

我试过产品 - >编辑方案并将 -com.apple.CoreData.SQLDebug 1 添加到启动时通过的参数,但我在日志中仍未看到任何输出。

I've tried "Product" -> "Edit Scheme" and added "-com.apple.CoreData.SQLDebug 1" to "Arguments Passed on Launch", but I'm still not seeing any output in the logs. Not sure if I'm looking in the wrong place or just passing the arguments incorrectly.

推荐答案

您应该查看相同的你得到NSLOGS

You should be looking at the same place you get NSLOGS

然后你应该去产品 - >编辑方案 - >然后从左面板选择运行YOURAPP.app并转到主面板的Arguments标签。

And you should Go to Product -> Edit Scheme -> Then from the left panel select Run YOURAPP.app and go to the main panel's Arguments Tab.

您可以添加在发布时传递的参数。

There you can add an Argument Passed On Launch.

您应该添加 com.apple.CoreData.SQLDebug 1

按下[确定],即可完成设定。

Press OK and your are all set.

这里的关键是编辑您将用于测试的方案。

The key here is to edit the scheme you will be using for testing.

这篇关于XCode4和Core Data:如何启用SQL调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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