Having
enum {MyA, MyB, Null};
typedef NSNumber myEnum;
Or
typedef enum {MyA, MyB, Null} myEnum;
1) How do I create an array
myEnum* myEnumTemp[] = {MyA, MyB};
Just gives "Implicit conversion of 'int' to NSNumber* is disallowed with ARC(ref. counting)
2) If you are able to create an array how to convert it to NSArray
?
In Obj C:
enumArray = @[@(enum1),@(enum2)];
In Swift:
enumArray = NSArray(objects: enum1.rawValue, enum2.rawValue);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With