xcode之静态扫描( Xcode static analyzer)

Static Analysis 是基于Clang 的非常好的静态代码分析工具。

主要从以下几个方面进行检测:

  • Logic flaws, such as accessing uninitialized variables and dereferencing null pointers(逻辑错误,比如访问未初始化的变量、解引用空指针)

  • Memory management flaws, such as leaking allocated memory(内存管理错误,比如内存泄露,在MRC机制下很有用)
  • Dead store (unused variable) flaws(死存储,比如未使用的变量)
  • API-usage flaws that result from not following the policies required by the frameworks and libraries the project is using(API使用错误)
使用方法:

1、点击product -> Analyze(shift+command+B)



2、选择某一条分析消息



3、点击相应的消息



4、点击箭头,查看错误跟踪线



5、编辑代码修改错误


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值