term for user
application preferences. Mac OS X
has a well-designed user defaults system that is accessed in Cocoa
through the Foundation class
. Working with
NSUserDefaults is similar to working with an
NSDictionary. Default values are stored in the
database by keys that the application developer defines in the
application. The defaults database is actually a collection of
property list files; every application has its own property list file
where defaults are stored. You can view these files in
Defaults are organized into
which are groupings of default values that have varying degrees of
visibility to applications. A domain is either
Defaults in a persistent domain are stored in the
defaults database, while defaults in a volatile domain are applicable only
during the lifetime of the
that contains those values.
five standard domains:
Set values for defaults in the argument domain by passing key-value
pairs to the application as arguments on the command line, (e.g.,
% MyApp -KeyName
Value). The argument domain is volatile,
so arguments affect the application only during the application
session for which they were specified.
Application-specific defaults are stored here and kept persistently in the user’s defaults database.
Defaults stored in the global domain are applicable to all applications ...