Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
387 views
in Technique[技术] by (71.8m points)

iphone - How do I get the CoreData Debug argument to output to the console?

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.

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

-com.apple.CoreData.SQLDebug 1

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.

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?

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

The arguments are two separate arguments and should be entered in the arguments tab as such. -com.apple.CoreData.SQLDebug is one parameter and the value 1 is the second parameter.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...