Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Xcode 4 breakpoint actions

I want to use Xcodes capabilities to log certain data. In fact it should be quite simple to achive something similar to

NSLog(@"Size: %@", NSStringFromRect(self.view.frame));

with the Log Message action of a breakpoint. I tried variations of this:

Size: @NSStringFromRect([[self view] frame])@

but failed.

I already searched the Xcode documentation and was surprised how bad that feature is documented. The only bit of information I was able to find was about how configuring at sound playing action when hitting breakpoints.

like image 797
Jens Kohl Avatar asked Dec 06 '11 12:12

Jens Kohl


People also ask

How do I use breakpoint debugger?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.

Why breakpoint is not working in Xcode?

You might be pushing "Run" instead of "Debug" in which case your program is not running with the help of gdb, in which case you cannot expect breakpoints to work! In Xcode 6.4, there is now only a Run button and whether it runs a debug configuration or not depends on the currently selected scheme settings.

How do I debug in Xcode step by step?

When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.

How do I set a conditional breakpoint in Xcode?

You can set a conditional break point in Xcode by setting the breakpoint normally, then control-click on it and select Edit Breakpoint (choose Run -> Show -> Breakpoints). In the breakpoint entry, there is a Condition column.


1 Answers

How about

Size: @(CGRect)[[self view] frame]@
like image 108
fourplusone Avatar answered Sep 30 '22 11:09

fourplusone