Important: The information in this document is obsolete and should not be used for new development.
Inherits from | |
Implements | |
Package | com.apple.cocoa.foundation |
Companion guide |
An NSDictionary object stores a mutable set of entries.
A count of the number of entries in the dictionary
The set of keys contained in the dictionary
The objects that correspond to the keys in the dictionary
NSMutableDictionary
Creates a new dictionary.
removeObjectForKey
Removes the specified entry from the dictionary.
removeObjectsForKeys
Removes multiple entries from the dictionary.
The NSMutableDictionary class declares the programmatic interface to objects that manage mutable associations of keys and values. With its two efficient primitive methods—setObjectForKey
and removeObjectForKey
—this class adds modification operations to the basic operations it inherits from NSDictionary.
The other methods declared here operate by invoking one or both of these primitives. The nonprimitive methods provide convenient ways of adding or removing multiple entries at a time.
addEntriesFromDictionary
removeAllObjects
removeObjectForKey
removeObjectsForKeys
setDictionary
setObjectForKey
public NSMutableDictionary
()
Creates and returns an empty mutable dictionary.
public NSMutableDictionary
(NSDictionary otherDictionary)
Creates a mutable dictionary containing the keys and values found in otherDictionary.
Adds the entries from otherDictionary to the receiver.
public void addEntriesFromDictionary
(NSDictionary otherDictionary)
Each value object from otherDictionary is added directly to the receiver.
Empties the receiver of its entries.
public void removeAllObjects
()
Removes aKey and its associated value object from the receiver.
public void removeObjectForKey
(Object aKey)
Does nothing if aKey does not exist.
Removes one or more entries from the receiver.
public void removeObjectsForKeys
(NSArray keyArray)
The entries are identified by the keys in keyArray. If a key in keyArray does not exist, the entry is ignored.
Sets the receiver to entries in otherDictionary.
public void setDictionary
(NSDictionary otherDictionary)
setDictionary
does this by removing all entries from the receiver (with removeAllObjects
), then adding each entry from otherDictionary into the receiver.
Adds an entry to the receiver, consisting of aKey and its corresponding value object anObject.
public void setObjectForKey
(Object anObject, Object aKey)
The value object is added directly to the dictionary. Throws an InvalidArgumentException
if the key or value object is null
.
© 1997, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-07-24)