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?
I have an object that implements serializable, and I have a dictionary with a
Share
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 toencodeObject:forKey:).