• 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: Core Data and Non-standard attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data and Non-standard attributes


  • Subject: Re: Core Data and Non-standard attributes
  • From: mmalcolm crawford <email@hidden>
  • Date: Fri, 13 May 2005 00:53:43 -0700


On May 13, 2005, at 12:28 AM, Alexander Powell wrote:

The docs seem to assume all Objective-C objects or simple datatypes (even in the non-standard attributes section).

You mean this section:
<http://developer.apple.com/documentation/Cocoa/Conceptual/ CoreData/Articles/cdNSAttributes.html>
?


"If you want to use a scalar type or structure that is not one of those supported directly by Core Data and not one of the structures supported by key-value coding, you must store it in your managed object as an object—typically an NSValue instance, although you can also define your own custom class. [...] For any non-standard attribute type you want to use, you must choose a supported attribute type that you will use to store the value. Which supported type you choose depends on the non-standard type and what means there are of transforming it into a supported type. In many cases you can easily transform a non-supported object into an NSData object using an archiver."

I.e. if you want to support any other arbitrary data type you should be able to use it directly by writing the accessor methods as described, and creating a persistent representation as an NSValue object, or an NSData object, or any other of the supported types that you find convenient.

mmalc

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Core Data and Non-standard attributes
      • From: Alexander Powell <email@hidden>
References: 
 >Core Data and Non-standard attributes (From: Alexander Powell <email@hidden>)

  • Prev by Date: Re: Assertion in writeToFile:ofType:
  • Next by Date: Re: Is NSMethodSignature compiler-dependent?
  • Previous by thread: Core Data and Non-standard attributes
  • Next by thread: Re: Core Data and Non-standard attributes
  • Index(es):
    • Date
    • Thread