7

我想在 Xcode 中开发 iPhone 应用程序时抑制特定警告。警告是:

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

我知道我使用指令:

#pragma GCC diagnostic warning "-Wxxxxxxxxxxxx"

但是我不知道xxxxxxxxxxxx应该是什么。有任何想法吗?

(假设:这样做是有正当理由的。我需要这样做,因为否则我无法启用将警告视为错误选项。)

4

2 回答 2

1

如果问题只是您无法使用,-Werror则使用-Wno-protocol禁用该特定警告。并非所有警告都可以通过编译指示禁用。

于 2012-05-06T21:41:36.060 回答
-3

尝试这个。


@interface XXX: UIViewController < XYZ>
{

}

于 2010-11-10T08:53:30.997 回答