Quickies

[categories] [index] [all (527)] [latest]

Cocoa Foundation
  1. $ NSObjCMessageLoggingEnabled=YES /Library/XcodeBuilds/Debug/HelloWorld 
    2009-02-04 10:54:41.728 HelloWorld[39133:10b] Hello, World!
    
    $ cat /tmp/msgSends-39133 
    + NSRecursiveLock NSObject initialize
    + NSRecursiveLock NSObject new
    + NSRecursiveLock NSObject alloc
    ...
    

    Tracing can be activated selectively in code:

    #import <objc/runtime.h>
    
    instrumentObjcMessageSends(YES);
    // messages will be traced here
    instrumentObjcMessageSends(NO);