Instance Method インスタンスメソッド

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. NSMutableDictionaryオブジェクトと違い、キャッシュはそれの中へと置かれるキーオブジェクトをコピーしません。

See Also 参照

Adding and Removing Cached Values キャッシュされた値を追加および除去する