Objective-C Category Providing Detailed Class Introspection In The LLDB Console

  •  
  •  
  •  
  •  
  •  

Recently I mentioned an Xcode plugin for visualizing autoresize masks from Denis Lebedev.

Here’s another interesting open source project from Denis Lebedev that provides an NSObject category wrapping enhancing the print object command for when you’re using the LLDB console.

The enhanced print object command displays the instance variables, methods, protocols used by a provided Objective-C class.

You can even display return types and arguments (in most cases).

Here’s an example from the Readme showing example console output displaying the properties of the UIDevice class:

~ po [[UIDevice class] properties]
@property (nonatomic, assign, readonly) BOOL _useSheetRotation,
@property (nonatomic, copy) @? afterAppearanceBlock,
...
@property (nonatomic, assign) {CGSize=ff} contentSizeForViewInPopover,
@property (nonatomic, assign, getter=isInAnimatedVCTransition) BOOL inAnimatedVCTransition,
@property (nonatomic, assign, readonly) BOOL inExplicitAppearanceTransition

You can find DLIntrospection on Github here.

An interesting project that can be very useful if you want quick introspection of an Objective-C class.


  •  
  •  
  •  
  •  
  •  

Leave a Reply