I'm missing something fundamental about using the NSCoding protocol archive/unarchive object information.
We are supposed to persist a user's favorite articles to disk using NSCoding protocols on a data class we created. I assume this means we create a data class for the favorite articles.
If so, for each new favorite article, do we create a separate file? Or do all the articles get saved to the same file?
If the same file, how do we parse the file to get all the objects?
So far I believe I'm successfully creating and saving to a file, but it appears that each time I try to save a new object, I overwrite whatever object is already there.
I'm missing something fundamental about using the NSCoding protocol archive/unarchive object information.
We are supposed to persist a user's favorite articles to disk using NSCoding protocols on a data class we created. I assume this means we create a data class for the favorite articles.
If so, for each new favorite article, do we create a separate file? Or do all the articles get saved to the same file?
If the same file, how do we parse the file to get all the objects?
So far I believe I'm successfully creating and saving to a file, but it appears that each time I try to save a new object, I overwrite whatever object is already there.
This is my sloppy code:
// when creating/saving object
// when unarchiving