On Apr 5, 2011, at 4:36 PM, Carter R. Harrison wrote: > ...when I relaunch the application and Core Data tries to unarchive them I > receive an exception like: > > *** -[NSKeyedUnarchiver decodeObjectForKey:]: cannot decode object of class > (DiskSpaceAlert) > > I can't tell exactly why this is happening. My plugin class implements the > NSCoding protocol. I'm thinking that it's happening because at the time of > unarchiving, my plugin's bundle has not been loaded and thus the > NSKeyedArchiver can't find my class (DiskSpaceAlert in this case). So I > added code to dynamically load all of my plugin bundles prior to the point > where they are unarchived but this hasn't fixed anything. > > Can anybody help me out? Thank you in advance.
Now, I haven't investigated doing this at all, but you may need to do an extra step after loading your plugins, and that would be to get the objective-c runtime to insert your classes into the in-memory runtime structures. You may need to query the class by name or try to manually instantiate/delete an instance of each class in the plugin [say, by calling a function in each plugin to do so]. It may also depend on how you are loading your plugins, as in, if you load them using an objective-c API, it may add your classes to the runtime when the plugin loads whereas if you use unix plugin code, it wouldn't. Eli _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com