(Preliminary Documentation) Copyright ã1994 by NeXT Computer, Inc.  All Rights Reserved.

NSDictionary 

Inherits From:	NSObject 

Conforms To:	NSCoding
NSCopying
NSMutableCopying
NSObject 

Declared In:	foundation/NSDictionary.h 

Allocating and Initializing 

+ (id)allocWithZone:(NSZone *)zone	Creates and returns an uninitialized dictionary object in zone.
+ (id)dictionary	Creates and returns an empty dictionary object.
+ (id)dictionaryWithContentsOfFile:(NSString *)path  
	Creates and returns a dictionary object from the keys and values found in the file specified by path.
+ (id)dictionaryWithObjects:(NSArray *)objects	Creates and returns a dictionary object that associates   
forKeys:(NSArray *)keys		objects from the objects array with keys from the keys array.  Keys must be strings.
+ (id)dictionaryWithObjects:(id *)objects	Creates and returns a dictionary object containing count  
forKeys:(id *)keys		objects from the objects array.  The objects are
count:(unsigned int)count		associated with count keys taken from the keys array.
+ (id)dictionaryWithObjectsAndKeys:(id)firstObject, ...
	Creates and returns a dictionary object that associates objects and keys from the argument list.  The list must be in form: object1, key1, object2, key2, ..., nil.
- (id)initWithContentsOfFile:(NSString *)path	Initializes a newly allocated dictionary object using the keys and values found in filename.
- (id)initWithDictionary:(NSDictionary *)dictionary
	Initializes a newly allocated dictionary object by placing in it the keys and values contained in otherDictionary.
- (id)initWithObjectsAndKeys:(id)firstObject...	Initializes a newly allocated dictionary object by placing in it the objects and keys from the argument list.  The list must be in form: object1, key1, object2, key2, ..., nil.
- (id)initWithObjects:(NSArray *)objects	Initializes a newly allocated dictionary object by      
forKeys:(NSArray *)keys		associating objects from the objects array with keys from the keys array.  Keys must be strings.
- (id)initWithObjects:(id *)objects	Initializes a newly allocated dictionary object by      
forKeys:(id *)keys		associating count objects from the objects array with an
count:(unsigned)count		equal number of keys from the keys array.

Accessing Keys and Values 

- (NSArray *)allKeys	Returns an array containing the dictionary's keys or an empty array if the dictionary has no entries.
- (NSArray *)allKeysForObject:(id)object	Finds all occurrences of the value anObject in the dictionary and returns an array with the corresponding keys. 
- (NSArray *)allValues	Returns an array containing the dictionary's values, or an empty array if the dictionary has no entries.
- (NSEnumerator *)keyEnumerator	Returns an enumerator object that lets you access each key in the dictionary.
- (NSEnumerator *)objectEnumerator	Returns an enumerator object that lets you access each value in the dictionary.
- (id)objectForKey:(id)aKey	Returns an entry's value given its key, or nil if no value is associated with aKey.

Counting Entries 

- (unsigned)count	Returns the number of entries in the dictionary.

Comparing Dictionaries 

- (BOOL)isEqualToDictionary:(NSDictionary *)other
	Compares the receiving dictionary object to otherDictionary.  If the contents of otherDictionary are equal to the contents of the receiver, this method returns YES.  If not, it returns NO.

Storing Dictionaries 

- (NSString *)description	Returns a string that represents the contents of the receiver.
- (NSString *)descriptionInStringsFileFormat	Returns a string that represents the contents of the receiver.  Key-value pairs are represented in a appropriate for use in ª.stringsº files
- (NSString *)descriptionWithLocale:(NSDictionary *)localeDictionary
	Returns a string representation of the NSDictionary object.  Included are the key and values that represent the locale data from localeDictionary.
- (NSString *)descriptionWithLocale:(NSDictionary *)localeDictionary
indent:(unsigned int)level	Returns a string representation of the NSDictionary object.  Included are the key and values that represent the locale data from localeDictionary.  Elements of the array are indented from the left margin by level + 1 multiples of four spaces, to make the output more readable.
- (BOOL)writeToFile:(NSString *)path	Writes a textual description of the contents of the 
atomically:(BOOL)useAuxiliaryFile		dictionary to filename.  If useAuxiliaryFile is YES, the data is written to a backup file and then, assuming no errors occur, the backup file is renamed to the intended file name.