EcUserDefaults documentation

Authors

Richard Frith-Macdonald (rfm@gnu.org)

Copyright: (C) 2012 Free Software Foundation, Inc.

Software documentation for the NSUserDefaults(EcUserDefaults) category

NSUserDefaults(EcUserDefaults)

Declared in:
EcUserDefaults.h
This category simply provides an easy way to work with user defaults where you want all keys to share a common prefix.
Method summary

prefixedDefaults 

+ (NSUserDefaults*) prefixedDefaults;
Returns the latest prefixed version of the shared user defaults, or nil if none has been set up.

userDefaultsWithPrefix: strict: 

+ (NSUserDefaults*) userDefaultsWithPrefix: (NSString*)aPrefix strict: (BOOL)enforcePrefix;
Returns a proxy to the shared user defaults instance, which will use aPrefix at the start of every key.
If aPrefix is nil, the string given by the EcUserDefaultsPrefix user default is used.
If the enforcePrefix flag is YES, the prefix is strictly enforced, otherwise the system will read defaults using the unprefixed key if no value is found for the prefixed key.

defaultsPrefix 

- (NSString*) defaultsPrefix;
Returns the prefix used by the receiver, or nil if no prefix is in use.

key: 

- (NSString*) key: (NSString*)aKey;
Convenience method to prepend the pefix to the supplied aKey value if it is not already present.

setCommand: forKey: 

- (BOOL) setCommand: (id)val forKey: (NSString*)key;
Sets a value to take precedence over others (in the volatile domain reserved for commands issued to the current process by an operator).
Returns YES if the configuration was changed, NO otherwise.

setConfiguration: 

- (BOOL) setConfiguration: (NSDictionary*)config;
Replaces the system central configuration information for this process with the contents of the dictionary. Values in this dictionary take precedence over other configured values except for those set using the -setCommand:forKey: method.
Returns YES if the configuration changed, NO otherwise.