Xcode 4和核心数据:如何启用SQL调试 [英] Xcode 4 and Core Data: How to enable SQL Debugging

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

问题描述

我正在使用通用的iOS应用,调试时希望在日志中看到原始SQL。此博客文章中有一些信息 用于iOS核心数据开发的原始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

,然后转到产品->编辑方案->然后从左侧面板中选择Run YOURAPP.app,然后转到主面板的参数选项卡。

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 4 (数字介于1到4之间,数字越大,它越冗长)

You should add -com.apple.CoreData.SQLDebug 4 (number between 1 and 4, higher number makes it more verbose)

按确定就可以了设置。

此处的关键是编辑将用于测试的方案。

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

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

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