1. 程式人生 > >iOS使用Instrument的Leaks查找代碼內存泄露

iOS使用Instrument的Leaks查找代碼內存泄露

ont leak get nts http pop xcod 項目 tips

Here are some tips for finding leaks in our project:


1. 打開Instruments調試工具控制欄, Xcode -> Open Dev Tool -> Instruments

技術分享


2.選擇Leaks工具

技術分享


3.設置Leaks內選項 選擇Leaks, 選擇Call Tree

技術分享


4.Run your App !

技術分享


5.設置Call Tree 選擇Invert Call Tree , Hide System Libraries, 然後選擇Leaks的項目 Target為你執行中的App, 點擊紅色圓圈執行,操作你App, 有紅色的柱狀就代表有內存泄露。查看對應的代碼,解決!

技術分享


iOS使用Instrument的Leaks查找代碼內存泄露