From: Christiaan H. <cmh...@gm...> - 2007-06-14 15:27:51
|
I am very much confused by the behavior of super. I thought it always referred to the instance 'self' referring to the implementation of its superclass to look up methods. So what happens if I re-assign self, does it still refer to the current self with the superclass's implementation of the current self? Or does it somehow stick with the superclass of the original self? Let me give the concrete problem. In -[PDFAnnotation initWithDictionary:], I did something like: ... self = [[SKPDFAnnotationNote alloc] initWithBounds:bounds]; ... [(PDFAnnotationText *)super setIconType:iconType]; ... This gave me a run time error, saying that SKPDFAnnotationNote does not implement -setIconType. Even though it inherits it from its superclass (and moreover I call super, sot self, so why would it even look in SKPDFAnnotation's implementation?) Christiaan |