A typedef in Objective-C is exactly the same as a typedef in C . And an enum in Objective-C is exactly the same as an enum in C. This declares an enum with three constants kCircle = 0, kRectangle = 1 and kOblateSpheroid = 2, and gives the enum type the name ShapeType.
Read moreWhat is the difference between typedef and enum in C?
A typedef declaration creates a new name (an alias) for an existing type. It does not define a new type. An enum declaration defines a discrete type with named values . If you’re trying to learn C by asking one question at a time, that’s not a good approach.
Read moreDo you need to typedef enum?
The typedef keyword is used to name user-defined objects. Structures often have to be declared multiple times in the code. Without defining them using typedef each declaration would need to start with the struct / enum keyword , which makes the code quite overloaded for readability.10 Oca 2021
Read more