self
is an instance variable used to refer to an instance of the current object.
You are attempting to use it in a class level method +(void)...
where self
has no meaning. Try using a shared instance, or passing an instance of the class in question to the method.
+ (void) run:(Action)action on:(MyClass*) instance after:(int) seconds
{
[instance run:action after:seconds repeat:NO];
}
EDIT
My commenters have pointed out that self
does have meaning in class level contexts, but it refers to the class itself. That would mean you were trying to call a method that looks like this:
[MyClass run:action after:seconds repeat:NO];
Where you should be aiming for:
[myClassInstance run:action after:seconds repeat:NO];
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…