Quickies

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

Cocoa Foundation
  1. Show help

    $ export OBJC_HELP=YES
    
    $ /Applications/TextEdit.app/Contents/MacOS/TextEdit
    (...)
    OBJC_HELP: describe available environment variables
    OBJC_PRINT_IMAGES: log image and library names as they are loaded
    OBJC_PRINT_LOAD_METHODS: log calls to class and category +load methods
    OBJC_PRINT_INITIALIZE_METHODS: log calls to class +initialize methods
    OBJC_PRINT_RESOLVED_METHODS: log methods created by +resolveClassMethod: and +resolveInstanceMethod:
    

    Log Objective-C messages

    $ export NSObjCMessageLoggingEnabled=YES
    
    $ /Applications/TextEdit.app/Contents/MacOS/TextEdit
    
    $ tail -f /tmp/msgSends-<pid>
    - NSLock NSLock lock
    + NSThread NSThread currentThread
    - NSThread NSObject hash
    - NSCFArray NSCFArray countByEnumeratingWithState:objects:count:
    - NSLock NSLock unlock
    - NSLock NSLock lock
    + NSThread NSThread currentThread
    - NSThread NSObject hash
    - NSCFArray NSCFArray countByEnumeratingWithState:objects:count:
    - NSLock NSLock unlock