I have an object that implements serializable, and I have a dictionary with a few of that objects. When I compile and run, I get lots of warnings saying that I'm replacing values for keys. That happens because when serializing the next object in the dictionary, it stores it's variables with the same key as the previous one did, right? How can I solve this? is there a way to know in the encodeWithCoder method if any variable has been stored with that name?
encodeWithCoder:
has no problem with multiple dictionaries that have the same key or with the same key appearing in multiple objects. Your problem is more likely that you're encoding multiple things with the same key in the same object (i.e. in your calls to encodeObject:forKey:
).
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