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

Core Data and Non-standard attributes


  • Subject: Core Data and Non-standard attributes
  • From: Alexander Powell <email@hidden>
  • Date: Fri, 13 May 2005 03:28:07 -0400

Hey all,

I've been trying to upgrade some of my research projects with document saving/loading and wanted to give Core Data a try. So far, I've been very impressed, but I'm running into an issue:

First of all, I use (extensively) a Vec3 and Mat4 datatype (along with a few other similar datatypes, such as Quaternions) which represent a 3-dimensional float vector and a 4x4 float matrix. These datatypes are C++ classes (I'm using Objective-C++)-- I use them because of the convenience of operator overloading which makes perfect sense for vectors and isn't possible (is it?) in simple Objective-C.

But I'm kinda confused as to how to use these datatypes as attributes in Core Data. I can certainly get the values out of the vectors (or matrices) and store them in another format when it comes time to update the persistent store. But after trying to implement this several times (in several different ways) based on the Core Data Programming Guide, I haven't yet been successful. The closest thing I could get was to create attributes for each float and update them individually each time the whole vector is updated, but I'm not sure if this is the right way to go.

The docs seem to assume all Objective-C objects or simple datatypes (even in the non-standard attributes section). It says, for non- Objective-C objects, "if the non-supported attribute is one of the structures supported by key-value coding..." and I'm not sure I know what it means for a structure to support key-value coding... Isn't an NSPoint a simple struct containing two floats? What does it know about key-value coding?


Thanks a bunch,

-- A-lex
_______________________________________________
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: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Assertion in writeToFile:ofType:
  • Next by Date: Re: Assertion in writeToFile:ofType:
  • Previous by thread: Re: Assertion in writeToFile:ofType:
  • Next by thread: Re: Core Data and Non-standard attributes
  • Index(es):
    • Date
    • Thread