title: Override a method in a single object instance
body: <p>Am not sure how to put this, and I couldn't find the answer because of my inability to find the words to express what am looking for. (!)</p>
  
  <p>In Java, I used to do something like this (I don't remember):</p>
  
  <pre><code>JPanel myButton = new JPanel("Press me"){
      public void add(JComponent component){
          //override add method
      }
  };
  </code></pre>
  
  <p>But, i couldn't find how to do this in Objective-C .. What I found in my search was categories and weird ^{} symbols ...</p>
  
  <p>So, how can I override method(s) in a newly created object?</p>
  
  <p>(For example, override <code>-(BOOL)isEqual;</code> in a newly created <code>NSString*</code> ?)</p>
  
  <p>Am sorry if the question is a bit vague..</p>
  
  <p>EDIT:</p>
  
  <p>Obviously, without subclassing :)</p>
  
  <p>EDIT:</p>
  
  <p>Might as well post my problem in case someone has a better idea:</p>
  
  <p>I have a few CCTransitions in COCOS2D, and I want to be notified when the transition ends .. The thing is, as soon as the transition ends, the -(void)finish; method is invoked (which is part of the CCTransition class structure)</p>
  
  <p>I would really want to avoid subclassing the CCTransition class, and override the finish method to do my logic when the transition ends :)</p>
  
  <p>EDIT:</p>
  
  <p><b>-(void)onEnterTransitionDidFinish;</b> ... I can't believe something as awesome as that existed and I haven't came across it while searching......</p>
  
  <p>Which means, instead of subclassing CCTransition, override this method in my CCNode subclass :D!</p>