I cannot compile my because of this error in my header:
error: expected identifier [1]
-(void) removeAllEntitiesOfClass:(Class)class;
with the caret pointing to the lowercase class.
Removing this function makes it compile again.
My class is a subclass of NSObject, which has public methods that use Class, so I thought this would automagically be declared.
I also tried changing Class to Class* and forward declaring with @Class Class, and this doesn’t work – it says it is a redefinition because I am changing the type. Apparently Class is a typedef’d struct pointer. I’m not sure how to forward declare that here, and I seem to recall it can be nasty business to forward declare a pointer typedef. Please correct me if I’m wrong, and tell me what file to import or how to forward declare.
@interface GameState : NSObject {
...
}
...
-(void) removeAllEntitiesOfClass:(Class)class;
@end
I suspect your header is visible in an Objective-C++ translation. In C++,
classis a keyword. To fix this, change the parameter’s name fromclassto some non-keyword.