Xcode 4.3 Description of Breakpoint Logging Objects

I would like to move from NSLogging everywhere to using breakpoints for logging where this cannot be avoided.

I know that I can just poan object with the action of the Debugger Command, and I know that I can just register any line by choosing the Log Message action.

And I think that I could combine both by selecting Log Message and typing something like SomeText giving context for object description: @(const char *)[[anObject description] UTF8String]@. Unfortunately, this does not work, and always gives me what I think is a pointer to a description line.

What am I doing wrong?

+3
source share
2 answers

, , . . :

po (NSString *) [@"Some text describing: " stringByAppendingString:(NSString *)[anObject description]]

, . GDB, LLDB.

, , , . NSLogs , () Xcode.

+2

(Edit: , )

, DebugLog. , ( def -ine DEBUG , define ). , ( ).

NSLog(@"Hello, World!");

DebugLog(@"Hello, World!");

19/4/12 8:55:52.949 PM Dictionary: Hello, World!

:

BetterDictionary.m:737 Hello, World!

( , )

. undefine DEBUG DebugLog .

#import 'DebugLog.h'.

+1

All Articles