I've been sitting on some deprecated unarchiving code for a while now and finally had the chance to debug it, so I'll do a slight necro of this thread to add a little context to what the OP and other developers might be running into.
If you're archiving a deep structure containing collections, it appears that it is not enough to give a "full" set of classes to the root unarchiver, you must also give the classes that are needed as you init the hierarchy of objects (e.g., via decodeObjectOfClasses:forKey:).
For example, I have an array of servers (a custom class of mine), each of which has a main URL attribute as well as an attribute that's a subarray of multiple endpoint URLs. The (secure) unarchiver kept complaining about NSURL not being allowed, despite being in the initial set, until I changed the decode for that subarray, too.
Hope that's useful info. The documentation could be improved when it comes to all of this and, really, the API itself could be enhanced to do a better job at maintaining encapsulation instead of expecting the developers to know the guts of how every class gets encoded.
Topic:
App & System Services
SubTopic:
General
Tags: