iOS

iOS中去除Warning

过期方法的 warning 消除

#pragma clang diagnostic push
#pragma clang diagnostic ignored "警告标识的描述"  // 例如 -Wdeprecated-declarations
//    过期的方法      //
#pragma clang diagnostic pop

//  for example 

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        return [self.text sizeWithFont:self.font constrainedToSize:CGSizeMake(CGFLOAT_MAX, height) lineBreakMode:self.lineBreakMode];
#pragma clang diagnostic pop

//警告标识的描述 的查找方法 
step 1) find "show the issue navigator"

step 2) find the issue 

step 3) reveal in log 

step 4) read message such as 
UILabel+Extension.m:48:27: warning: 'sizeWithFont:constrainedToSize:lineBreakMode:' is deprecated: first deprecated in iOS 7.0 - Use -boundingRectWithSize:options:attributes:context:
 
 
 [-Wdeprecated-declarations] // 描述标识 

architecture x86_64

warning: no rule to process file 'README.md' of type net.daringfireball.markdown for architecture x86_64.
引用地址

we can resolve that things with simply following step:-

Step 1) Select Project Navigator
Step 2) Select your project
Step 3) Select your targetStep 
4) Select Build PhasesStep 
5) Move files which we don't want the compiler to process from Compile Sources to Copy Bundle Resources

解决方式2

引用位置

Select the project target
Select the Build Phases
Expand the Compile Source
Remove the Header file (Reachability.h)
note : for removing the Reachability.h file from Compile Source, first select the file and then press the - button

If you need the header, then make sure that it is added to the "Headers" list below "Compile Sources".

iOS
支付宝扫码打赏 微信打赏

若你觉得我的文章对你有帮助,欢迎点击上方按钮对我打赏

扫描二维码,分享此文章

段连洁's Picture
段连洁

iOSer

Subscribe to JAY 站 | Share Thoughts

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!

Comments