So in Objective C or Objective C++, if you pass in a pointer to something not a basic type (like ‘int’ or ‘double’ or ‘void’), the Objective C compiler thinks it’s an Objective C class. It needs to know this so it can perform automatic reference counting.
If you need to pass in a pointer to a class or a structure object, write this instead:
- (void)function:(class CPPClass *)classPtr;
- (void)function:(struct CStruct *)structPtr;
Otherwise, if you don’t use the
struct pointer qualifiers, Objective C++ (and presumably Objective C for the
struct keyword) will think it’s an Objective C class, and the compiler will fail.