On 02.04.2008, at 13:28, Daniel Thorpe wrote:

Hello everyone,

I'm trying to get to grips with non-standard persistent attributes in Core Data. I've read through the docs I can find (http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdNSAttributes.html ) but I'm still having some issues storing an NSRect in an entity. I've set the type to be transformable, and left the value transformer field empty using the model editor.

If you leave the transformer field empty it uses NSKeyedUnarchiveFromDataTransformerName as default. But unfortunately NSKeyedArchiver can not encode/decode NSValues containing a struct. You could use NSUnarchiveFromDataTransformerName as a workaround. (NSArchiver/NSUnarchiver)
is able to encode/decode a NSValue containing a NSRect).

Or implement the approach described in the section "Scalar Values" in the documentation you
mentioned (it contains an example using a NSRect).

Cheers,

felix


_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to