How to store enum values in a NSMutableArray

前端 未结 6 1197
故里飘歌
故里飘歌 2021-02-06 22:58

My problem is since an enum in objective-c essentially is an int value, I am not able to store it in a NSMutableArray. Apparently NSMutableArray won\'t

6条回答
  •  灰色年华
    2021-02-06 23:15

    You can wrap your enum values in a NSNumber object:

    [NSNumber numberWithInt:green];
    

提交回复
热议问题