Since switching to XCode 4, I have been having issues finding how to set environment variables (such a NSZombies) in iPhone executables. In XCode 3, you could right-click on your .app file, select "Get Info" and set environment variables. But it doesn't seem possible to do this in XCode 4. Where is it in the new UI?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
another way would be if you click on the scheme drop down bar -> edit scheme -> arguments tab and then add NSZombieEnabled in the Environment Variables column and YES in the value column...
回答2:
Please see this answer: How do I set up NSZombieEnabled in Xcode 4?
EDIT: You can also go to this menu from Product => Edit Scheme
回答3:
If you want act on the value of environment variable in your own code, use the following:
NSDictionary *env = [[NSProcessInfo processInfo] environment];
Edit Scheme... / Run / Arguments / Environment
is where to go to edit the environment variables for runs from Xcode.