The following code is supposed to return current item name
typedef enum ItemName {test1, test2} ItemName;
- (BOOL)DoItemName{return ItemName;}
But I receive this error:
error: Semantic Issue: Unexpected type name 'ItemName': expected expression
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.
In your code
ItemNamedefines a type, not a value. So writingreturn ItemNameis equivalent toreturn int, which doesn’t have any meaningful interpretation. The compiler tells you exactly this.