Duplicate protocol definition warning, but I need a summary of this protocol

Note. This is similar to this question , but it is not the same. I promise.

I have a number of table views that require a modal view to sort the contents of a table. To do this, I installed a simple protocol in a single table controller header file, and it worked perfectly. Then I copied this protocol to other table view controllers and received this warning:

Duplicate protocol definition "ModalViewDelegate" is ignored

Now I understand that this is just a warning, but I would not see it every time I compile. To get rid of the warnings, I imported the header file in which the protocol was originally defined. Once again, I was not completely satisfied. It seems inaccurate to import the header file into each kind of table so that I can use the protocol without warning.

If you read this, I thank you. My questions are: “Why is this happening? Is there a better way to get rid of this warning while continuing to use the same protocol? '

+5
source share
2 answers

Is there a better way to get rid of this warning while continuing to use the same protocol?

, . : , , , : @protocol MyProtocol;. , ( ); , , , , .. .

, , .

, , . , , , .

+7

, @protocol . .h .

+2

All Articles