title: Using Super in an Objective C Category?
body: <p>I'd like to override a method in an Objective C class that I don't have the source to.</p>
  
  <p>I've looked into it, and it appears that Categories should allow me to do this, but I'd like to use the result of the old method in my new method, using super to get the old methods result.</p>
  
  <p>Whenever I try this though, my method gets called, but "super" is nil... Any idea why? I'm doing iPhone development with the XCode 2.2 SDK. I'm definitely working with an instance of a class, and the method of the class is an instance method. </p>
  
  <pre><code>@implementation SampleClass (filePathResolver)
  -(NSString*) fullPathFromRelativePath:(NSString*) relPath
  {
      NSString *result = [super fullPathFromRelativePath: relPath];
  
    ... do some stuff with the old result
  
      return result;
  }
  </code></pre>
  
  <p>Note and clarification: From what I can see in the Apple Docs, it appears to me that this should be allowed?</p>
  
  <blockquote>
    <p><a href="https://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocCategories.html#//apple_ref/doc/uid/TP30001163-CH20-SW1" rel="noreferrer">Categories docs at developer.apple.com:</a>
    When a category overrides an inherited method, the method in the
    category can, as usual, invoke the
    inherited implementation via a message
    to super. However, if a category
    overrides a method that already
    existed in the category's class, there
    is no way to invoke the original
    implementation.</p>
  </blockquote>