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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To define a custom type, the correct way is with a typedef.
Try…
EDIT:
Not long after this question was asked and answered, Apple came out with a new way to do enumerated data types. Here’s an in-depth article on it.