How to use Xcode 4 breakpoint actions

I want to use the capabilities of Xcodes to log certain data. It should actually be pretty easy to achieve something similar to

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

with action Log Message breakpoints. I tried options for this:

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

but failed.

I was already looking for Xcode documentation and was surprised at how poorly this feature is documented. The only bit of information that I could find was how to adjust when playing sound when reaching breakpoints.

+6
source share
2 answers

What about

 Size: @(CGRect)[[self view] frame]@ 
+8
source

Another solution would be:

 Size: @(const char *)[[[[some objects] object] description] UTF8String]@ 

The conclusion is not as good as the one in the four-process answer, but it will work with all objects that provide a good description.

+3
source

Source: https://habr.com/ru/post/903187/


All Articles