Solving circular protocol declarations

前端 未结 1 903
無奈伤痛
無奈伤痛 2021-01-23 08:44

I am trying to solve this, there are similar questions but none are fit for my issue

I have .h file with a a @protocol. The @interface needs to have that @protocol defin

相关标签:
1条回答
  • 2021-01-23 09:21

    Forward-declare the class:

    @class MyClass;    // Forward declaration
    
    @protocol MyProtocol
    ...
    @end
    
    @interface MyClass
    ...
    @end
    
    0 讨论(0)
提交回复
热议问题