I'd like to see the content of NSObjects like properties ( arrays, Integers, floats... ). Since I'm a Flex developer I'm used to use the eclipse debugging tool. But now I'm starting with the iPhone I'm kind of lost.
For example, I just downloaded the SeismicXML application from the dev's sample code, and I 开发者_StackOverflow社区put a breakpoint on the connectionDidFinishLoading and parseEarthquakeData methods.
I'd like to print the data ( the xml ) but I don't know how.
THe only thing I could achieve is to print the object using the po command on the gdb.
Any idea?
Note: XCode 4 and above has improved the debugging system.
Unfortunately the visual property viewer doesn't seem to be as nice as I'd like. I spend a good chunk of my time in the gdb console issuing all kinds of crazy print statements.
How can I debug objects on XCode
On the top left of XCode you can see a drop down menu, make sure to choose "Debug" as the Active config. Put your breakpoints then open Debuuger (from Run menu) You should see something like this
(source: cocoalab.com)
As you can see there is step buttons just like Eclipse.
I'd like to print the data ( the xml ) but I don't know how.
Do you mean printing it to Console? like while tracing?
In that case, you can use NSLog(NSString *string);
精彩评论