NSKeyArchiver and NSKeyUnarchiver

106 views Asked by At

I'm quite new to Swift, and I just started with persistence. I was wondering how the NSKeyUnarchiver works.

NSKeyedUnarchiver.unarchiveObject(withFile: file)

This is my current code. I have the file, but I don't know exactly what I'm getting. What if I archived multiple objects? How do I know which one I'm pulling? Somebody please help.

1

There are 1 answers

0
Alexander On

Only a single object can be archived per file. However, this can be an array, a dictionary, or other collection type, which stores multiple objects.