p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #1e9421}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #000000; min-height: 21.0px}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #c81b13}p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #3c828b}p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #c42275}p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #000000}p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px 'PingFang SC'; color: #1e9421}p.p8 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #1e9421; min-height: 21.0px}p.p9 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #3e1e81}p.p10 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #822d0f}p.p11 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Menlo; color: #1337ff}span.s1 {font-variant-ligatures: no-common-ligatures}span.s2 {font: 18.0px 'PingFang SC'; font-variant-ligatures: no-common-ligatures}span.s3 {font-variant-ligatures: no-common-ligatures; color: #822d0f}span.s4 {font-variant-ligatures: no-common-ligatures; color: #c42275}span.s5 {font-variant-ligatures: no-common-ligatures; color: #000000}span.s6 {font: 18.0px Menlo; font-variant-ligatures: no-common-ligatures}span.s7 {font: 18.0px Menlo; font-variant-ligatures: no-common-ligatures; color: #000000}span.s8 {font-variant-ligatures: no-common-ligatures; color: #c81b13}span.s9 {font-variant-ligatures: no-common-ligatures; color: #6122ae}span.s10 {font-variant-ligatures: no-common-ligatures; color: #3e1e81}span.s11 {font-variant-ligatures: no-common-ligatures; color: #1e9421}span.s12 {font-variant-ligatures: no-common-ligatures; color: #1337ff}
//
// ViewController.m
// pragma
//
// Created by Code_Hou on 2017/3/30.
// Copyright © 2017年 侯森魁. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
/*
#pragma 在本质上是声明,常用的功能就是注释,尤其是给Code分段注释;然而它还有另外一个强大的功能是处理编译器警告.
clang diagnostic 是#pragma 第一个常用命令:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-相关命令"
//自己的代码
#pragma clang pop
*/
- (void)viewDidLoad {
[super viewDidLoad];
//取消方法启用的警告
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"1" message:@"2" delegate:nil cancelButtonTitle:@"3" otherButtonTitles:@"4", nil];
[alert show];
#pragma clang diagnostic pop
//取消不兼容指针类型警告
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
//
#pragma clang diagnostic pop
//取消循环引用的警告
// completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-retain-cycles"
// self.completionBlock = ^ {
// ...
// };
#pragma clang diagnostic pop
//取消未使用变量的警告
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"
int a;
#pragma clang pop
// Do any additional setup after loading the view, typically from a nib.
}
/*
#pargma 用法详情:
http://nshipster.cn/pragma/
http://nshipster.com/clang-diagnostics/
http://fuckingclangwarnings.com/
http://clang.llvm.org/docs/UsersManual.[html](http://www.2cto.com/kf/qianduan/css/)#diagnostics_pragmas
*/
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
#pragma处理警告
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 首先#pragma在本质上是声明,常用的功能就是注释,尤其是给Code分段注释;而且它还有另一个强大的功能是处理编...
- 使用#pragma 声明是彰显 Objective-C 工艺的标志之一。虽然 #pragma 最初的目的是为了使得...