I’m trying to figure out how to use the log or debug commands in adding actions to a breakpoint. I can’t seem to figure it out. For something like this:
double currentZoom = [self getZoomScale];
How do I print out the currentZoom? I tried using log as my action, and then doing
currentZoom: @(double)currentZoom@ // this didn't work
currentZoom: @(double)[self getZoomScale]@ // also didn't work
Can someone help me out with this and any other info I may need to log information with breakpoints?
And also a simple example for po an object. Does po always po the description (as in you have to have overridden the description method? Thanks.
If you want to print your double with NSLog, add the following line:
Now, if you want to use the debugger console…
If you want to print currentZoom in the console, you don’t need po. Plain p would be enough.This is, type
and it’s going to show you currentZoom’s value. po is for objects. Let’s say you wrap currentZoom in an NSNumber.
Then, to print the value, you would have to do
Like i said, po is to print objects, it means print object. So you can use it to print any type of object, from NSStrings and NSNumbers to NSDictionaries and NSManagedObjects.