Is there a way to inspect NSCache's contents for debugging purposes?
This would not be used in the App Store. I just would like to be able to see what's going on in there while debugging. The description
is pretty useless.
No need to use a third party library. You can do this using the "allObjects" key from NSCache. For example:
if let all = yourCache.value(forKey: "allObjects") as? NSArray {
for object in all {
print("object is \(object)")
}
}
There is an open-source replacement for NSCache that solves this exact issue: https://github.com/gregkrsak/GKCache
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With