Instance Method

objects(forKeys:notFoundMarker:)

Returns as a static array the set of objects from the dictionary that corresponds to the specified keys.

Declaration

func objects(forKeys keys: [Any], notFoundMarker marker: Any) -> [Any]

Parameters

keys

An NSArray containing the keys for which to return corresponding values.

anObject

The marker object to place in the corresponding element of the returned array if an object isn’t found in the dictionary to correspond to a given key.

Discussion

The objects in the returned array and the keys array have a one-for-one correspondence, so that the n

the object in the returned array corresponds to the nthe key in keys.

See Also

Accessing Keys and Values

var allKeys: [Any]

A new array containing the dictionary’s keys, or an empty array if the dictionary has no entries.

func allKeys(for: Any) -> [Any]

Returns a new array containing the keys corresponding to all occurrences of a given object in the dictionary.

var allValues: [Any]

A new array containing the dictionary’s values, or an empty array if the dictionary has no entries.

func value(forKey: String) -> Any?

Returns the value associated with a given key.

func object(forKey: Any) -> Any?

Returns the value associated with a given key.

subscript(NSCopying) -> Any?

Returns the value associated with a given key.

subscript(Any) -> Any?

Accesses the value associated with a given key.