I am trying to use NSInvocation
to call a superclass method from a subclass. The code used is relatively simple, it looks like this:
- (NSInvocation*) invocationWithSelector:(SEL)selector { NSInvocation* call = [[NSInvocation alloc] init]; [call retainArguments]; call.target = super; //ERROR: use of undeclared identifier 'super' call.selector = @selector(selector); return call; }
It seems to me that this is a bit strange, since I always thought that super
adheres to almost the same rules as self
(i.e. it can be considered as a direct reference to the object in question and assigned to variables, used as a return value, etc. ) This does not seem to be the case in practice.
Anyway, is there an easy way to get my NSInvocation
aim at implementing a superclass (I can't use self
as a target because the subclass overrides the methods of the superclass), or do I need to look for some other suitable ones?
source share