Re: Core Data & Custom Class
Re: Core Data & Custom Class
- Subject: Re: Core Data & Custom Class
- From: mmalcolm crawford <email@hidden>
- Date: Tue, 27 Dec 2005 14:49:09 -0800
On Dec 27, 2005, at 2:28 PM, Todd Freese wrote:
Just starting to port my first application to core data. I am a
little confused on when to use a custom managed object class. I
have created my data model in the modeler. Is there a set of
guidelines on when you need to create custom class files from the
data modeler?
"NSManagedObject is a generic class that implements all the basic
behavior required of a managed object. You may create custom
subclasses of NSManagedObject, although this is often not required.
**If no custom logic is needed, a complete object graph can be formed
with NSManagedObject instances.**"
<
http://developer.apple.com/documentation/Cocoa/Reference/
CoreData_ObjC/Classes/NSManagedObject_index.html>
One of my data classes needs to store a custom type. I created a
transient, undefined attribute and a persistent, binary attribute.
I assume that I need to generate files in order to create the
accessor methods.
Yes:
<
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/
Articles/cdNSAttributes.html>:
Basic Approach
[...] **You then implement a custom managed object class with
suitable accessor methods for the transient attribute that retrieve
the value from and store the value to the persistent attribute.**"
But do I have to do this for all my data classes, or just the ones
that need a little more tweaking?
See above.
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