标签云

微信群

扫码加入我们

WeChat QR Code

This code won't compile and generates the error message "Expected a type". As the type is declared right above I don't understand why.enum TMyType{Etype1,Etype2};@interface Factory : NSObject+ (void) foo: (TMyType) actionType;@end


Thanks, what does .mm represent?

2019年04月20日24分43秒

Mungbeans it represents an objective-c++ source file. In C/Obj-C, an enum must be fully typed, e.g. enum myType myArg = myEnumValue;. In C++, you can simply reference it like this: myType myArg = myEnumValue;, as the C++ compiler will infer the enum automatically.

2019年04月19日24分43秒

objective-c++ like I suggested in parenthetic remark.

2019年04月19日24分43秒

Not that I object the downvote, but I'd appreciate an explanation.

2019年04月19日24分43秒