【问题标题】:Can clang detect IBActionAttr in iOS?clang 可以在 iOS 中检测到 IBActionAttr 吗?
【发布时间】:2016-06-30 05:15:47
【问题描述】:

我已经为 Objective C 方法转储了 AST 的内容,其中一些方法有一个 IBActionAttr 作为其子项。

但是,IBActionAttr 不是 Stmt 或 Decl。我应该如何检测 ObjCMethodDecl 是否有 IBActionAttr?

【问题讨论】:

    标签: ios clang abstract-syntax-tree static-analysis llvm-clang


    【解决方案1】:

    使用来自Decl 的方法hasAttr<IBActionAttr>() 工作正常

    如果 Decl 具有属性 IBActionAttr,则Decl->hasAttr<IBActionAttr>() 返回 true

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      • 2021-12-31
      • 2012-07-01
      • 2017-10-18
      相关资源
      最近更新 更多