Hacker News new | ask | show | jobs
by RVijay007 4699 days ago
I started using NS_ENUM, but I noticed that if I used it in a header file, if I tried to make a property or variable of the enum type: @property (assign) EnumType, it would require this to prefaced with enum, i.e. @property (assign) enum EnumType.

If you just type typedef enum {...} EnumType, you could write @property (assign) EnumType. I prefer this format in my source code, so I quit using NS_ENUM.

1 comments

I'm not seeing the same behavior. Just whipped up a test project and I'm able to define an enum with the macro and import it into a view controller which declares a property of that type.

What your describing would suggest that perhaps you left out the 'typedef' before calling the macro.