zoukankan      html  css  js  c++  java
  • 消除部分xcode警告

    问题现象

    某些时候使用了一些deprecated的方法,每次编译xcode都会有提示,想去掉这些指定遗弃方法使用的提示

    问题解决

    #define WC_DeprecatedDeclarationsWarning(stuff)

    do {

    _Pragma("clang diagnostic push")

    _Pragma("clang diagnostic ignored "-Wdeprecated-declarations"")

    stuff;

    _Pragma("clang diagnostic pop")

    }while (0)

     

    WC_DeprecatedDeclarationsWarning(

            [APService registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |

                                                           UIRemoteNotificationTypeSound |

                                                           UIRemoteNotificationTypeAlert)

                                               categories:nil];);

    这样这里的UIRemoteNotificationTypeBadge就不会出现警告

     

    常用警告相关命令

    方法弃用告警    -Wdeprecated-declarations

    不兼容指针类型    -Wincompatible-pointer-types

    循环引用        -Warc-retain-cycles

    未使用变量      -Wunused-variable

    详细列表参考《http://fuckingclangwarnings.com/》

     

  • 相关阅读:
    龟兔赛跑(动态规划)
    Dividing (多重背包 搜索)
    第k大值01背包问题
    FATE(完全背包)
    01背包 和 完全背包 详解
    放苹果(动态规划)
    max Sum(简单动态规划)
    连连看 优先对列 应用2
    尺取法
    Square(强大的剪枝)
  • 原文地址:https://www.cnblogs.com/ftrako/p/4221600.html
Copyright © 2011-2022 走看看