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

查看:31
本文介绍了Xcode 4 和 Core Data:如何启用 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

You should be looking at the same place you get NSLOGS

你应该去 Product -> Edit Scheme -> 然后从左侧面板选择 Run 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 4(1到4之间的数字,数字越大越详细)

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

按 OK 即可.

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

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

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

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