Xcode中去掉烦人的警告

By | 2016年1月7日

// 让编译器忽略烦人的内存泄漏警告(慎用)

#pragma clang diagnostic push

#pragma clang diagnostic ignored “-Warc-performSelector-leaks”

data = [[NSData class] performSelector:dataWithUncompressedContentsOfFile withObject:bundlePath];

#pragma clang diagnostic pop

 

 

// 见不见为净的不兼容指针

#pragma clang diagnostic push

#pragma clang diagnostic ignored “-Wincompatible-pointer-types”

#pragma clang diagnostic pop

 

// 没有使用过的变量再也不提示了

#pragma clang diagnostic push

#pragma clang diagnostic ignored “-Wunused-variable”

NSString *strParams = @””;

#pragma clang diagnostic pop

 

http://clang.llvm.org/docs/UsersManual.html#diagnostics_pragmas