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.
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.
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.
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.
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.
How about
Size: @(CGRect)[[self view] frame]@
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With