Xcode Breakpoint: shortcut for file name or class name

Xcode has a shortcut when setting a breakpoint %B. Placed in the "Log message", it prints the name of the breakpoint on the console. breakpoint namewhat is the name of the method.

So creating a breakpoint in - (void)viewDidLoadwill print

-viewDidLoad

When the breakpoint stops, everything becomes clear. But when the application continues after evaluating only viewDidLoadwhat is printed in the debug console, it will not indicate which class was called. viewDidLoadmay be in every ViewController. Therefore, I am adding a class name to determine the location (see image).

In order not to enter the full name of the class, I use the initials: MGA_OneViewControllerit becomesOVC

Breakppint with Log Message "OVC% B"

OVC %B outputs a conclusion

OVG -viewDidLoad

and now the class is known.

( ) , , , .

, , Craig p (void)NSLog(@"%s: %@", _cmd)

SO (16661758, 12695845) .

, : ? A Percent-F ? , ?

+3
1

@[self class]@ %B, , , , , .

+1

All Articles