• 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: Howard Griffith <email@hidden>
  • Date: Wed, 26 Feb 2003 08:34:22 -0800 (PST)

Alvaro,

I store the preferences for my project in a
NSDictionary which I write to the plist file with this
line:

[newDefaults
writeToFile:[@"~/Library/Preferences/com.howard.plist"
stringByExpandingTildeInPath] atomically:YES];

When it comes time to read it I use:

oldAppDefaults = [[NSDictionary
dictionaryWithContentsOfFile:[@"~/Library/Preferences/com.howard.plist"
stringByExpandingTildeInPath]] retain];

Which can be checked to see if it is empty before
actually using the settings by using:

if ([oldAppDefaults count] == 0)

Hope this helps a little.

--- Alvaro Muir <email@hidden> 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?
>
>
> --
>
> Alvaro Muir
> Columbia University LRC
>
> Im : alvaromuir
> email@hidden
> email@hidden
> _______________________________________________
> 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.
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
_______________________________________________
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: Subclassing NSLayoutManager for terminal emulator application?
  • Next by Date: initialFirstResponder not working for NSTableView/NSTextView
  • Previous by thread: Re: Settings via plist
  • Next by thread: Different Menu View?!
  • Index(es):
    • Date
    • Thread