开发者

Suppress "does not implement protocol" warning in GCC

开发者 https://www.devze.com 2023-01-24 02:20 出处:网络
I want to suppress a particular warning while developing an iPhone app in Xcode. The warning is: \"warning: class \'XXX\' does not implement the \'XYZ\' protocol\"

I want to suppress a particular warning while developing an iPhone app in Xcode. The warning is:

"warning: class 'XXX' does not implement the 'XYZ' protocol"

I understand I use the directive:

#pragma GCC diagnostic warning "-Wxxxxxxxxxxxx"

But I don't know what the xxxxxxxxxxxx should be. Any ideas?

(Assumption: there is a valid reason for doing this. And I need to do this because otherwise I can't enable the treat warnings as errors option开发者_运维知识库.)


If the problem is just that you can't use -Werror then use -Wno-protocol to disable that particular warning. Not all warnings can be disabled by pragmas.


Try this.


@interface XXX: UIViewController < XYZ>
{

}

0

精彩评论

暂无评论...
验证码 换一张
取 消