开发者

How to set environment variables in iPhone executable using XCode 4?

开发者 https://www.devze.com 2023-02-16 20:08 出处:网络
Since switching to XCode 4, I have been having issues finding how to set environment variables (such a NSZomb开发者_开发技巧ies) in iPhone executables. In XCode 3, you could right-click on your .app f

Since switching to XCode 4, I have been having issues finding how to set environment variables (such a NSZomb开发者_开发技巧ies) 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?


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...


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消