Finding the line of memory leak in Instruments

2019-03-29 20:11发布

I am new to Instruments in iOS. I am trying to find the memory leak in instruments and using Xcode 4.5.2 and following this tutorial: http://soulwithmobiletechnology.blogspot.sg/2011/04/how-to-check-memory-leaks-in-xcode-4.html.

I am able to find the memory leak and able to press the arrow to go to history of the memory leak item. But when i double-click any of them, it doesn't show the line it is causing the memory leak.

The image is like this:

enter image description here

What am i doing wrong? Need some guidance... Thanks..

1条回答
贼婆χ
2楼-- · 2019-03-29 20:30

I had trouble finding it at first too. Here's how:

  1. Select the Leaks instrument (obviously).
  2. Show the "Extended Detail" Pane by clicking the Icon in the toolbar that toggles it from the right.
  3. Select Your leaked item from the list.
  4. Double Click on the entry there you see your Application Name and/or one of your Classes, which has a User Icon next to it to take you to the problematic code. (There can be more than one)

enter image description here

Double clicking that (4), will take you directly to the file, and line of code in question:

enter image description here

查看更多
登录 后发表回答