1.进入Edit Scheme设置页面。
[img]http://dl.iteye.com/upload/attachment/0079/8764/bfce97b4-0a2f-3ac3-961c-8c40a74298e2.png[/img]
2.在Diagnostics面板中选中Enable Zombie Objects和Malloc Stack选项。
[img]http://dl.iteye.com/upload/attachment/0079/8766/88d440b2-d417-3a01-b014-35aaf9d3be88.png[/img]
3.把xcode4.5默认的Debugger设置为GDB。
[img]http://dl.iteye.com/upload/attachment/0079/8768/7a2e616a-2f52-3d19-adba-2ae35c7eed2c.png[/img]
4.当出现message sent to deallocated instance ******,键入info malloc-history ******。
[img]http://dl.iteye.com/upload/attachment/0079/8773/de692ee8-6689-328b-8c39-037409b5131c.png[/img]
5.根据堆栈信息,定位到内存泄漏的代码。
[img]http://dl.iteye.com/upload/attachment/0079/8777/1e4a0cec-6cd9-3b92-8c84-e3d546e85ff3.png[/img]
[img]http://dl.iteye.com/upload/attachment/0079/8764/bfce97b4-0a2f-3ac3-961c-8c40a74298e2.png[/img]
2.在Diagnostics面板中选中Enable Zombie Objects和Malloc Stack选项。
[img]http://dl.iteye.com/upload/attachment/0079/8766/88d440b2-d417-3a01-b014-35aaf9d3be88.png[/img]
3.把xcode4.5默认的Debugger设置为GDB。
[img]http://dl.iteye.com/upload/attachment/0079/8768/7a2e616a-2f52-3d19-adba-2ae35c7eed2c.png[/img]
4.当出现message sent to deallocated instance ******,键入info malloc-history ******。
[img]http://dl.iteye.com/upload/attachment/0079/8773/de692ee8-6689-328b-8c39-037409b5131c.png[/img]
5.根据堆栈信息,定位到内存泄漏的代码。
[img]http://dl.iteye.com/upload/attachment/0079/8777/1e4a0cec-6cd9-3b92-8c84-e3d546e85ff3.png[/img]