Core Data and Non-standard attributes
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