InspectiveC

From iPhone Development Wiki
Revision as of 01:46, 23 February 2015 by GoldDavid (talk | contribs)

InspectiveC is an Objective-C library that you can use in order to log useful information about certain objects, classes, and selectors.

The source code and README can be found at the Github page.

Usage

You can view the official documentation at the Github page linked above. In the example below, I'll be using the InspCWrapper.

#include "InspCWrapper.m"

%hook SBApplicationController

- (id)init {
  id result = %orig;
  // Watch this object.
  watchObject(result);
  return result;
}


%end

%ctor {
  %init;
  // Watch all direct instances of SBDockView.
  watchClass(%c(SBDockView));
  // Watch all methods named "icon:launchFromLocation:".
  watchSelector(@selector(icon:launchFromLocation:));
}