Jens Kohl
Jens Kohl

Reputation: 5969

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.

Upvotes: 6

Views: 1718

Answers (2)

Pfitz
Pfitz

Reputation: 7344

Another solution would be:

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

The output is not as nice as the one in fourplusone answer but it will work with all objects which provide a good description.

Upvotes: 3

fourplusone
fourplusone

Reputation: 151

How about

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

Upvotes: 8

Related Questions