I’m just trying to figure out if the values themselves are int, unsigned int, NSInteger. I thought I saw someone say that they were unsigned ints, but in Apple’s header files I’ve seen them used to store negative values.
Share
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.
An enum is a feature of C (and C++), not Objective-C. When you declare an enum you declare a new C data type.
The size of a given enum data type may be the size of a
int, or it may only be just large enough to hold each of the declared enum values. It’s compiler specific, and there are usually compiler settings to control how enums are handled.The largest an enum can be is
int, so you can always convert any enum value to anint. The reverse is not true; you cannot necessarily convert anyintto an enum value.