Using enums as parameters in an external file in Objective-C?

后端 未结 3 1309
予麋鹿
予麋鹿 2021-02-14 17:23

I have an enum named RandomEnum in file foo.h:

// foo.h
typedef enum RandomEnum {
  ran_1 = 0,
  ran_2
} RandomEnum;

In another file, bar.h, I\

3条回答
  •  温柔的废话
    2021-02-14 17:40

    As @Chuck said, it will work if you do this if you don't want to declare a typedef:

    -(RandomEnum)echo:(enum RandomEnum)ran;
    

提交回复
热议问题