• 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: Settings via plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Settings via plist


  • Subject: Re: Settings via plist
  • From: David Remahl <email@hidden>
  • Date: Tue, 25 Feb 2003 03:03:06 +0100

It's as simple as this (if the settings are stored in a dictionary plist file in the resources folder of the application package, and it contains a key, "Host"):

NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"plist"];
NSDictionary *settings = [NSDictionary dictionaryWithContentsOfFile:plistPath];
NSString *sqlHost = [settings objectForKey:@"Host"];

/ Rgds, David

On Monday, February 24, 2003, at 08:41 PM, Alvaro Muir wrote:

Hello all,
Short newbie question. Could anyone point me in the right direction in
implementing a plist for some of my variables? I am trying to build a small
cocoa app using the cocoa-mysql framework, and I would like to keep all of
the connection info in a plist, as opposed to hard coded in, or
user-prompted. Could anyone help?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Settings via plist (From: Alvaro Muir <email@hidden>)

  • Prev by Date: Settings via plist
  • Next by Date: Different Menu View?!
  • Previous by thread: Settings via plist
  • Next by thread: Re: Settings via plist
  • Index(es):
    • Date
    • Thread