Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 Xcode 中开发 iPhone 应用程序时抑制特定警告。警告是:
"warning: class 'XXX' does not implement the 'XYZ' protocol"
我知道我使用指令:
#pragma GCC diagnostic warning "-Wxxxxxxxxxxxx"
但是我不知道xxxxxxxxxxxx应该是什么。有任何想法吗?
(假设:这样做是有正当理由的。我需要这样做,因为否则我无法启用将警告视为错误选项。)
如果问题只是您无法使用,-Werror则使用-Wno-protocol禁用该特定警告。并非所有警告都可以通过编译指示禁用。
-Werror
-Wno-protocol
尝试这个。
@interface XXX: UIViewController < XYZ> { }
}