Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 611
Jason Avatar asked Mar 14 '11 06:03

Jason


People also ask

How do I set an environment variable in export?

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

What is environment variable in Swift?

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"] { }


1 Answers

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

like image 125
learner2010 Avatar answered Oct 15 '22 01:10

learner2010