• 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: How to store NSRect as Core Data attribute?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to store NSRect as Core Data attribute? (From: Daniel Thorpe <email@hidden>)

  • Prev by Date: prefPane with background process
  • Next by Date: Subviews of a borderless window - autoresizing mask does not work for me
  • Previous by thread: How to store NSRect as Core Data attribute?
  • Next by thread: Re: How to store NSRect as Core Data attribute?
  • Index(es):
    • Date
    • Thread