At the moment, I have a dictionary written like this, where Model is a generic:
private var cache = [String: Model]()
Sometime when I call the following:
cache.updateValue(model, forKey: uid)
I get the following crash:
Thread 14: "-[NSIndexPath count]: unrecognized selector sent to instance 0x8000000000000000"
Some other info about the state of the cache when the crash occurs:
- The dictionary is storing 1205 key/value pairs
- The value being updated does not exist
According to the summary on Apples documentation for updateValue:
Updates the value stored in the dictionary for the given key, or adds a new key-value pair if the key does not exist.
Can someone please explain what is happening and how to fix this issue?