• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Dynamically Loading Code and Core Data Non-Standard Persistent Attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dynamically Loading Code and Core Data Non-Standard Persistent Attributes


  • Subject: Dynamically Loading Code and Core Data Non-Standard Persistent Attributes
  • From: "Carter R. Harrison" <email@hidden>
  • Date: Tue, 05 Apr 2011 18:36:07 -0400

My Core Data application has a plugin architecture.  Plugins reside within their own bundles and of course are loaded dynamically at runtime.  I intend to encode instances of each plugin bundle's principal class just as Apple describes it in the section of the Core Data Programming Guide called "Non-Standard Persistent Attributes".  In this section it explains that you should create an attribute of type "Transformable" within your entity.  This particular attribute is encoded and decoded using NSKeyedArchiving.  So the instances of my plugins archive correctly, but 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.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Dynamically Loading Code and Core Data Non-Standard Persistent Attributes
      • From: Eli Bach <email@hidden>
  • Prev by Date: Re: Drawing custom group row in TableView
  • Next by Date: Re: Odd NSCache Eviction Behaviour
  • Previous by thread: AVFoundation and YouTube?
  • Next by thread: Re: Dynamically Loading Code and Core Data Non-Standard Persistent Attributes
  • Index(es):
    • Date
    • Thread