• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Info.plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Info.plist


  • Subject: Re: Info.plist
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 27 Jun 2005 08:47:47 -0500

On 27 Jun 2005, at 4:41 AM, email@hidden wrote:

I'm having problem to set environment variables in the "Info.plist" configuration file of my C++ application build with XCode. I have stored the attached "Info.plist" file in the "Contents" folder of my application bundle but the application does not seem to have find variable "TEST_ENV_KEY" when using the stdc function getenv. Other environment variables that are set in the ".MacOSX/ environment.plist" configuration file of the user can be retrieved properly by my application. What am i missing?

Info.plist does not set environment variables. There is no way to attach environment variables to an executable file in Mac OS X. You can attach environment variables to an executable when it is launched from Xcode, but you can't attach them for general launching.


If you want to retrieve a value from Info.plist, look at CFBundleGetValueForInfoDictionaryKey(), or the equivalent method in NSBundle, objectForInfoDictionaryKey:.

In general, it would not be a good idea to put parameters in the Info.plist file; that's not what it's there for. Put a dictionary in a separate plist file, include it in your resource build phase, find it with the CFBundle or NSBundle API, and read it.

    -- F

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Info.plist
      • From: Daniel Jalkut <email@hidden>
References: 
 >Info.plist (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: What ends up in the "Bundle Resources" group
  • Next by Date: Re: What ends up in the "Bundle Resources" group
  • Previous by thread: Info.plist
  • Next by thread: Re: Info.plist
  • Index(es):
    • Date
    • Thread