18 points · by gdubs · 13y ago · 3 comments
Well, arrays of string constants are categorically the wrong tool for the job if you're talking about the function of a bitmask. You want a set for that, not an array. And it's not a bad idea to go ahead and use a dictionary since you can get the same functionality, and that will let you seamlessly add in non-boolean options down the line.
Except in tightly optimized code, I really think that using bitmasks is an antipattern. It's way harder to inspect a bitmask than a set or dictionary when debugging, and code dealing with them tends to be less readable. In addition, bitmasks sometimes have a tendency to encourage developers to be "clever" and do manipulations with them beyond simple &s and |s. Maintaining such code is, of course, a nightmare.
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.
What your describing would suggest that perhaps you left out the 'typedef' before calling the macro.