Adds a given key-value pair to the dictionary.
- iOS 6.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The value for
a. A strong reference to the object is maintained by the dictionary.
nilwill cause any object corresponding to
ato be removed from the dictionary.
The key for
value. The key is copied (using
copy; keys must conform to the
aalready exists in the dictionary,
antakes its place.
This method has the same behavior as the
You shouldn’t need to call this method directly. Instead, this method is called when setting an object for a key using subscripting.