How to conform to a self-made protocol?

后端 未结 7 1777
忘了有多久
忘了有多久 2021-02-10 16:33

I have a class with an delegate property. Anyone who wants to be a delegate must conform to a protocol. I defined everything like this:

#import 

        
相关标签:
7条回答
  • 2021-02-10 17:35

    Is this a warning? because sometimes it does that when you have circular references and stuff, and it gets confused, but in reality its ok, have u tried running it to see if it works? In my project i have a bunch of warning about protocols not found, they are there though and it works fine... What you can do to get rid of the warning is try defining the protocol outside the class on some other .h file. You also dont really need the forward declaration, you can just do #import of the .h file its defined in

    0 讨论(0)
提交回复
热议问题