+ newReturns a new empty dictionary.
- copyReturns a new copy of the dictionary.
- deepCopyReturns a new copy of the dictionary. The members in the new dictionary are deep copies of the members in the original dictionary.
- emptyYourselfRemoves all the keys and values of the dictionary (without freeing them). Returns the receiver.
- freeContentsRemoves and frees all the members of the receiver, but doesn't free the receiver itself. Returns the receiver.
- freeFrees the dictionary, but not its contents. Returns nil. Do :
if you want to free the dictionary and its contents.aDic = [[aDic freeObjects] free];
- (unsigned) sizeReturns the number of key-value associations in the dictionary.
- (BOOL) isEmptyWhether the number of associations in the dictionary is equal to zero.
- (BOOL) includesKey : aKeyReturns YES if there is an association with key matching aKey.
- (unsigned) hashReturns a hash value based on the receiver's address and the results of sending the hash message to the contents.
- (BOOL) isEqual : aDicReturns YES if aDic is a dictionary, and if its keys and values respond affirmatively to the message isEqual: when compared to the corresponding objects of the receiver's contents.
- atKey : aKeyReturns the value of the association matching aKey. Returns nil if the association is not found.
- atKeySTR :(STR) strKeyReturns the value of the association matching strKey. Returns nil if the association is not found.
- atKey : aKey put : anObjectAssociates aKey to anObject. Adds the objects to the dictionary. If aKey was already in the dictionary, makes anObject the value for this key and returns the old value. Otherwise returns nil.
- atKeySTR :(STR) strKey put : anObjectAssociates strKey to anObject. Adds the objects to the dictionary. If strKey was already in the dictionary, makes anObject the value for this key and returns the old value. Otherwise returns nil.
- eachKeyReturns a sequence of the key objects in the dictionary.
See also: eachValuekeys = [aDic eachKey]; while ((aKey = [aSeq next])) { /* do something */ } keys = [keys free];
- eachValueReturns a sequence of the value objects in the dictionary.
See also: eachKeykeys = [aDic eachKey]; values = [aDic eachValue]; while ((aKey = [aSeq next])) { aValue = [values next]; /* do something */ } keys = [keys free]; values = [values free];
- printToFile :(FILE *) aFilePrints a comma separated list of the key-value pairs by sending each individual object a printToFile: message. Returns the receiver.
- write :(NXTypedStream *) streamArchives the dictionary and its set of key-values associations to stream.
- read :(NXTypedStream *) streamUnarchives the dictionary and its set of key-values associations from stream.