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?
To set an environment variable, use the command " export varname=value ", which sets the variable and exports it to the global environment (available to other processes). Enclosed the value with double quotes if it contains spaces. To set a local variable, use the command " varname =value " (or " set varname =value ").
The name of the environment variable is a key in the dictionary. Use that key to get the environment variable's value. The following code demonstrates how to access a variable containing a GitHub OAuth app's client ID: if let clientID = ProcessInfo.processInfo. environment["GITHUB_CLIENT_ID"] { }
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With