设置NSZombieEnabled和MallocStackLogging

在XCode,4以上版本中,设置NSZombieEnabled和MallocStackLogging

1.点击XCode的Product菜单,选择Edit Scheme...选项

2.选择左侧的Run...,右边点击Arguments

3.在Environment Variables栏里,添加NSZombieEnabled,value为YES;再添加MallocStackLogging,value为YES;

如下图所示:

以上选项只能在模拟器上有效,如果你改变了iOS的版本,需要重新设定。 

调试结束后,最好记得把环境变量NSZombieEnabled,MallocStackLogging前面的勾去掉,因为它们会使得内存不会被释放.

posted @ 2012-02-14 11:14  月光的尽头  阅读(7757)  评论(0编辑  收藏  举报