去掉Xcode工程中的某种类型的警告

简介: 在我们的项目中,通常使用了大量的第三方代码,这些代码可能很复杂,我们不敢改动他们,可是作者已经停止更新了

前言

在我们的项目中,通常使用了大量的第三方代码,这些代码可能很复杂,我们不敢改动他们,可是作者已经停止更新了,当sdk升级或者是编译器升级后,这些遗留的代码可能会出现许许多多的警告,那么我们有没有办法去掉这些烦人的警告,不然一个工程几百个警告,你看着怎么都不爽吧.我们怎么去掉警告呢

关闭工程中指定 类型的警告


工程的target有一个 Other Warning Flags



在里面添加排除类型


在警告窗口,某个警告上,我们右击,显示出右键菜单,选择其中的 Reveal in Log




则会显示语句,注意到其中 [-Wshorten-64-to-32],在这个括号中的就是 这种警告的类型   -W是前缀,这个前缀表示的是 打开这种类型的警告 如果我们是要关闭某种类型的警告的话, 要将 -W换成 -Wno-

这样就得到了  -Wno-shorten-64-to-32了.

常用的屏蔽类型

-Wshorten-64-to-32 -> -Wno-shorten-64-to-32 -Wimplicit-retain-self -> -Wno-implicit-retain-self -Wstrict-prototypes -> -Wno-strict-prototypes -Wincompatible-pointer-types -> -Wno-incompatible-pointer-types -Wdeprecated-declarations -> -Wno-deprecated-declarations -Wundeclared-selector -> -Wno-undeclared-selector -Wformat -> -Wno-format -Warc-performSelector-leaks -> -Wno-arc-performSelector-leaks


目录
相关文章
|
iOS开发
忽略 Xcode 8 中的注释警告
从Xcode8.0开始,引入了文档注释警告,虽然是件好事,可是各种三方库爆出了一大堆警告:
60 0
|
iOS开发
Xcode警告消除 ios WKWebView Could not signal service com.apple.WebKit.WebContent
Xcode警告消除 ios WKWebView Could not signal service com.apple.WebKit.WebContent
357 0
|
iOS开发
Xcode警告 XIB Setting the background color on UITableViewHeaderFooterView has been deprecated. Plea...
Xcode警告 XIB Setting the background color on UITableViewHeaderFooterView has been deprecated. Plea...
84 0
|
iOS开发
Xcode消除警告:Unknown class ViewController in Interface Builder file
Xcode消除警告:Unknown class ViewController in Interface Builder file
239 0
|
iOS开发
Xcode消除警告:-1: The iOS Simulator deployment target is set to 6.0, but the range of supported deplo...
Xcode消除警告:-1: The iOS Simulator deployment target is set to 6.0, but the range of supported deplo...
131 0
Xcode消除警告:-1: The iOS Simulator deployment target is set to 6.0, but the range of supported deplo...
|
存储 C语言 iOS开发
ios之Xcode工程中添加文件常用快捷键
ios之Xcode工程中添加文件常用快捷键
238 0
ios之Xcode工程中添加文件常用快捷键
|
iOS开发 开发者
Xcode关于警告AutomaticPreferredMaxLayoutWidth的消除方法
Xcode关于警告AutomaticPreferredMaxLayoutWidth的消除方法
118 0
Xcode关于警告AutomaticPreferredMaxLayoutWidth的消除方法