开发者

Finding leaks under GeneralBlock-16?

If ObjectAlloc cannot deduce type information for the block, it uses 'GeneralBlock'. Any strategies to get leaks from this block that may eliminate the need of my 'trial and error' me开发者_运维技巧thods that I use? The Extended Detail thing doesn't really do it for me as I just keep guessing.


I find that sometimes if in the leaks instrument you click the button that looks something like this: {= and drag your app delegate file onto the screen, it will lead you in the right direction by highlighting the code that allocated that leaked block.

Every time it goes into a function call drag the source file with that function onto it. This can be hit and miss though as sometimes these mystery leaks aren't tracked back to the delegate.


In XCode, you can try build and analyze. Sometimes it can be helpful in finding leaks and sometimes not. But it's worth a shot.


I've just started using objective-c and xcode (version 4) and it appears that by clicking on the leaked object in the memory profiler, you can see exactly the point in the code it is referring to in the "extended detail" pane. In here it shows you a stack trace and clicking on a point in the stack will take you to the exact point in the code where the leak is occuring. Not sure if this was available in v3. Hope this helps anyone else tracking down a leaky GeneralBlock-16.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜