Re: How to store NSRect as Core Data attribute?
Re: How to store NSRect as Core Data attribute?
- Subject: Re: How to store NSRect as Core Data attribute?
- From: Felix Franz <email@hidden>
- Date: Wed, 2 Apr 2008 15:11:13 +0200
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 (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