I have a form with information first name and last name and some other information. I use a person class to store this information. on submit click I archiving it in a file person.txt using NSCoding implemented in person class. if I add multiple persons in the file person.txt, how can I get all the person objects stored in the file. decoding the person class just gives me the last added person.
Share
If you want all of the person objects serialized, then you need the
NSArrayor whatever other collection class in which they are stored to be the root object for theNSKeyedArchiver. e.g.: (assumes ARC)Why the .txt extension on your archive, though? It just binary data, right?