• 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
Re: Managed Object with Transformable Attribute (C Struct)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Managed Object with Transformable Attribute (C Struct)


  • Subject: Re: Managed Object with Transformable Attribute (C Struct)
  • From: "Melissa J. Turner" <email@hidden>
  • Date: Wed, 16 Dec 2009 15:39:28 -0800

On Dec 15, 2009, at 20:47, Richard Somers wrote:

> On Dec 15, 2009, at 9:18 PM, Graham Cox wrote:
>
>> You're archiving 'value'. You want instead to return the mutableData that the first archiver wrote to, which is otherwise unused.
>
> Thanks. Saving keyed archive of struct foo now works for xml store (I think, when I open up the xml document I was expecting to see the keys for foo but instead just see data as before).
>
> Prior to this change document saved ok in xml and sqlite but save as binary resulted in error: *** -[NSKeyedArchiver encodeValueOfObjCType:at:]: this archiver cannot encode structs.
>
> With this change saving to xml is ok but saving as sqlite or binary results in error: The document could not be saved as "document".foo is a required value.
>
> My whole application works fine with core data, bindings, saving to different store types, etc. Just this one attribute is causing problems.
>
> Any ideas?
>

I think you're running into a known problem with the binary store not respecting the value transformer name and instead always using the default archiver (NSKeyedArchiver).

The only real workaround is to have a wrapper property (ie a property returning an NSData) that does the transform and persist that instead.

+Melissa


_______________________________________________

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: Managed Object with Transformable Attribute (C Struct)
      • From: Richard Somers <email@hidden>
    • Re: Managed Object with Transformable Attribute (C Struct)
      • From: Rob Keniger <email@hidden>
References: 
 >Managed Object with Transformable Attribute (C Struct) (From: Richard Somers <email@hidden>)
 >Re: Managed Object with Transformable Attribute (C Struct) (From: Jerry Krinock <email@hidden>)
 >Re: Managed Object with Transformable Attribute (C Struct) (From: Richard Somers <email@hidden>)
 >Re: Managed Object with Transformable Attribute (C Struct) (From: Graham Cox <email@hidden>)
 >Re: Managed Object with Transformable Attribute (C Struct) (From: Richard Somers <email@hidden>)

  • Prev by Date: Re: NSUndoManager auto-grouping?
  • Next by Date: Core Video - Getting Started
  • Previous by thread: Re: Managed Object with Transformable Attribute (C Struct)
  • Next by thread: Re: Managed Object with Transformable Attribute (C Struct)
  • Index(es):
    • Date
    • Thread