• 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: Value Transformer Name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Value Transformer Name


  • Subject: Re: Value Transformer Name
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 10 Apr 2009 09:41:28 -0700

On Apr 10, 2009, at 08:07, Keary Suska wrote:

I would file a bug against the documentation for clarification. I would hazard the guess that Core Data handles transformations differently when you specify a transformer name and when you don't. Hence the different errors.

That's exactly right. This is a beautifully engineered gotcha for the unwary programmer. The Core Data documentation says:


If you specify a custom transformer, it must transform an instance of the non-standard data type into an instance of NSData and support reverse transformation.

However, the NSKeyedUnarchiveFromDataTransformerName transformer transforms an instance of NSData to an instance of whatever was archived in it.


So, the default transformer goes *from* NSData. Custom transformers go *to* NSData.

So, you cannot specify the default transformer explicitly, because that would make Core Data use it in the wrong direction.


_______________________________________________

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: Value Transformer Name
      • From: Richard Somers <email@hidden>
References: 
 >Value Transformer Name (From: Richard Somers <email@hidden>)
 >Re: Value Transformer Name (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: Value Transformer Name
  • Next by Date: NSLocalizedStringFromTableInBundle Questions
  • Previous by thread: Re: Value Transformer Name
  • Next by thread: Re: Value Transformer Name
  • Index(es):
    • Date
    • Thread