Open Classswift 6.0.3Foundation
NSCache
class NSCache<KeyType, ObjectType> where KeyType : AnyObject, ObjectType : AnyObject
class NSCache<KeyType, ObjectType> where KeyType : AnyObject, ObjectType : AnyObject
import Foundation
class NSObject
The root class of most Foundation class hierarchies.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol NSObjectProtocol : AnyObject
The NSObjectProtocol
groups methods that are fundamental to all Foundation objects.
override init()
var countLimit: Int
weak var delegate: (any NSCacheDelegate)?
var evictsObjectsWithDiscardedContent: Bool
var name: String
var totalCostLimit: Int
func object(forKey key: KeyType) -> ObjectType?
func removeAllObjects()
func removeObject(forKey key: KeyType)
func setObject(_ obj: ObjectType, forKey key: KeyType)
func setObject(_ obj: ObjectType, forKey key: KeyType, cost g: Int)