I used NSKeyedArchiver.archiveRootObject(_,toFile:) in a command-line app to archive an instance of a Swift class. I am unable to unarchive in another, interactive, Swift app, getting the error message:
-[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class (AnAppName.AClassName) for key (root); the class may be defined in source code or a library that is not linked
The compiler has the AClassName.swift file and recognizes it OK. I presume the problem is that the archiver prepended the app name (as module?) and the unarchiver doesn't know what to do with it. The file is pretty expensive to produce, so I'd rather not redo it, if that can be avoided.
I guess that I should have created a Framework that could be linked to both the batch and interactive apps, but who knew?
Any ideas?
Richard Nerf