I was looking at enums in cocoa frameworks and I saw this:
enum {
NSNetServiceNoAutoRename = 1UL << 0
};
typedef NSUInteger NSNetServiceOptions;
and my question is how is this possible?
How is NSNetServiceOptions tied to that enum?
And is it only possible in objective c or also in c?
NSNetServiceOptions tied to that enum in the context that the enum is going to hold an integer value anyway. In the above example you will create a variable for the enum as,
You can even ignore the typedef and directly use,