How to store enum values in a NSMutableArray

前端 未结 6 1205
故里飘歌
故里飘歌 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:14

    NSMutableArray *corners = [[NSMutableArray alloc] initWithObjects:
                               @(Right), 
                               @(Top), 
                               @(Left), 
                               @(Bottom), nil];
    Corner cornerType = [corner[0] intValue];
    

提交回复
热议问题