NSZombieEnabled 不会关闭
我在我的论点中将 NSZombieEnabled 设置为 NO。
我正在检查它是否已启用:
if(getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled"))
{
NSLog(@"NSZombieEnabled/NSAutoreleaseFreedObjectCheckEnabled enabled!");
}
我的调试器说它仍然启用。为什么?
I have NSZombieEnabled to NO in my arguments.
I am checking to see if it is enabled:
if(getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled"))
{
NSLog(@"NSZombieEnabled/NSAutoreleaseFreedObjectCheckEnabled enabled!");
}
My debugger says it is still enabled. Why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试取消选中它。如果它前面没有复选标记,则不应将其传递给应用程序。
当您将值设置为 NO 时,它应该关闭,但 getenv("NSZombieEnabled") 将返回“NO”。这不是一个布尔NO而是一个cstring“NO”。所以 if 条件无论如何都是 true。
try to uncheck it. If it has no checkmark in front it shouldn't be passed to the application.
It should be off when you set the value to NO, but getenv("NSZombieEnabled") will return "NO". Which is not a boolean NO but a cstring "NO". So the if condition will be true anyway.
我知道这个问题很旧,但是为了人们的参考,您可以将这种技术用于许多调试标志:
如果它链接,它将起作用。
I know this question is old, but for people’s reference, you can use this technique for many debug flags:
If it links, it will work.
这是一个检查 env 变量是否存在以及正确值的建议。
Here's a suggestion which checks for both the existence of the env variable and the correct value.