• 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: Keary Suska <email@hidden>
  • Date: Fri, 10 Apr 2009 09:07:31 -0600

On Apr 10, 2009, at 8:15 AM, Richard Somers wrote:

In an Xcode data model window, a transformable attribute has an input labeled "Value Transformer Name:".

The Core Data Programming Guide says "By default, Core Data uses the NSKeyedUnarchiveFromDataTransformerName transformer, however you can specify your own transformer if you want."

In my test application various values for the "Value Transformer Name:" in the data model window produce the following error warnings.

1. blank -[NSKeyedArchiver encodeValueOfObjCType:at:]: this archiver cannot encode structs

2. NSKeyedUnarchiveFromDataTransformerName Warning: no NSValueTransformer with class name 'NSKeyedUnarchiveFromDataTransformerName' was found

3. NSKeyedUnarchiveFromData -[NSConcreteValue bytes]: unrecognized selector sent to instance

Questions

Why does number 2 not work when the documentation indicates that it should and is actually the default condition?

NSKeyedUnarchiveFromDataTransformerName is not the name of the transformer but the identifier for the constant string that contains the transformer name. Your test #3 demonstrates this fact, so wouldn't it be obvious?


If number 3 is really the same as the default condition then why does it not produce the exact same results as number 1?

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.


Why does the NSValueTransformer class have named transformers but those names can not be used in the Xcode data modeler or in Interface Builder without producing an error?

This is not a true statement. It may be the fact that you cannot use "NSKeyedUnarchiveFromDataTransformerName" as a specified name, but not that you can't use *any* named transformer. If you want the functionality of the default transformer, simply leave the transformer name blank. Who cares otherwise?


Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

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

  • Prev by Date: Re: Setting Min, MAx and range of characters for NSTextField
  • Next by Date: Re: NSURLConnection crashes with EXC_BAD_ADDRESS -- can't find why...
  • Previous by thread: Value Transformer Name
  • Next by thread: Re: Value Transformer Name
  • Index(es):
    • Date
    • Thread