In a nutshell an enum is a datatype you create where in theory only certain values can be assigned to it and none else.
The code is pretty straight forward. Here it goes:
typedef enum
{
North, South, East, West
} Direction;
@interface MyClassName : NSObject
{
Direction direction;
}
@property(nonatomic) Direction direction;
In the above example only the values North, South, East, and West can be assigned to the direction property of a MyClassName instance.
2 comments:
nice explanation.Thank you
it helped me...thnkx :)
Post a Comment