Forward-declare enum in Objective-C

前端 未结 6 2391
陌清茗
陌清茗 2020-11-30 02:06

I\'m having trouble with enum visibility in an Objective-C program. I have two header files, and one defines a typedef enum. Another file needs to use the

6条回答
  •  孤独总比滥情好
    2020-11-30 02:48

    You'd have to either #import them anyway or create a separate header file containing only the typedef. Not importing header files in a header makes the compilation faster, but doesn't change anything else.

    Why doesn't C++ support forward declaration of enums?

提交回复
热议问题