1.模拟一下内存泄露的问题
新建一个项目

2.Xcode 的 Instruments 工具集可以很方便的检测循环引用。

3.开始检测会出现如下结果

4.可以看到leaks中明确告诉你是哪个类中的什么方法中出现了内存的问题。我们可以切换到 Leaks 这栏,点击”Cycles & Roots”,这样就可以获得到详细的图解

这就是leaks的简单使用,希望大家能好好利用这个东西,也希望大家的项目永无bug!
1.模拟一下内存泄露的问题
新建一个项目
2.Xcode 的 Instruments 工具集可以很方便的检测循环引用。
3.开始检测会出现如下结果
4.可以看到leaks中明确告诉你是哪个类中的什么方法中出现了内存的问题。我们可以切换到 Leaks 这栏,点击”Cycles & Roots”,这样就可以获得到详细的图解
这就是leaks的简单使用,希望大家能好好利用这个东西,也希望大家的项目永无bug!
本文标题:xcode检测内存泄露leaks
本文链接:https://www.haomeiwen.com/subject/frombxtx.html
网友评论