In my app I am working with the SimpleKML framework
https://github.com/mapbox/Simple-KML
I have some big files which takes about 5 seconds to process thought this library. I was thinking to cache the object in something like NSData.
I have read this tutorial from Apple:
But i dont really know of using nscoder is the best way to do this. Can someone point me in the right direction?
You want to use
NSKeyedArchiverandNSKeyedUnarchiver.If the object you’re saving (and the objects it has as properties, and their properties, etc.) implement the
NSCodingprotocol then it’s, as simple asto archive the object into an NSData and then save it to disk, and then later
to load the data and unarchive the object from the data.
If not, you’ll need to override
initWithCoder:andencodeWithCoder:for the objects in question to make them serialize properly.