title: How to dynamically replace a method implementation in ObjC2?
body: <p>I am trying to learn how to write plugins using SIMBL. I got my plugin to load with the target application, and also know the method that I wish to override. However, I am not able to use class_getInstanceMethod correctly based on snippets on the Internet. Have things changed in OSX 10.6 and/or ObjC2?</p>
  
  <p>The following code from <a href="http://www.culater.net/wiki/moin.cgi/CocoaReverseEngineering#head-44c10b1f0da64ecad303c947b1823518f2682bae" rel="noreferrer">culater.net</a> gives "Dereferencing pointer to incomplete type" on the second-last statement:</p>
  
  <pre><code>BOOL DTRenameSelector(Class _class, SEL _oldSelector, SEL _newSelector)
  {
      Method method = nil;
  
      // First, look for the methods
      method = class_getInstanceMethod(_class, _oldSelector);
      if (method == nil)
          return NO;
  
      method-&gt;method_name = _newSelector;
      return YES;
  }
  </code></pre>
  
  <p>Is there a complete example of how to override a method using SIMBL plugins? Thanks!</p>