insertAll()

The dictionary.insertAll() function acts like a series of assignment statements, and copies the key/value entries from one dictionary to another. Note that you qualify the function with the name of the target dictionary.

If a key is in the source and not in the target, the key/value entry is copied to the target. If a key is in both the source and target, the value of the source entry overrides the entry in the target. The value of the caseSensitive property affects this determination. If both dictionaries have caseSensitive set to YES, the target dictionary creates a new entry for a key that differs from an existing key only in case. For example, the value of the key "Age" in the source dictionary overwrites the value of the key "age" in the target dictionary unless both dictionaries have caseSensitive set to YES.

This function is different from the assignment of one dictionary to another because the dictionary.insertAll() function preserves both the existing properties and the existing entries in the target dictionary.

Syntax

  targetDictionary.insertAll(sourceDictionary Dictionary in)
targetDictionary
The name of the dictionary variable to which the entries are to be copied.
sourceDictionary
The name of the dictionary variable from which the entries are to be copied.

Feedback