It's a primitive type. Don't use a pointer unless you have a very clear and specific reason to track a pointer to a primitive type (which will be very rare).
Should NSUInteger enum properties be pointers or just primitives?
-
19-10-2022 - |
Question
I have the following enum
:
typedef NS_ENUM(NSUInteger, GraphType) {
GraphTypeRawData,
GraphTypeFilteredData
};
The compiler accepts without warning me declaring it as a property primitive, or as a pointer:
@property (nonatomic, assign) GraphType graphType;
VS
@property (nonatomic, assign) GraphType *graphType;
Which is the correct one to use? (And why?)
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow