IOS 设置NSZombieEnabled和MallocStackLogging

来源:互联网 发布:南风知我意1七微书包网 编辑:程序博客网 时间:2024/05/18 23:53

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

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

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

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

如下图所示:

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

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


NSZombieEnabled YES
MallocStackLogging YES
MallocStackLoggingNoCompact YES

0 0