Contents

setObject(_:forKey:)

Sets the value of the specified key in the cache.

Declaration

func setObject(_ obj: ObjectType, forKey key: KeyType)

Parameters

  • obj:

    The object to be stored in the cache.

  • key:

    The key with which to associate the value.

Discussion

Unlike an NSMutableDictionary object, a cache does not copy the key objects that are put into it.

See Also

Adding and Removing Cached Values