Re: Fastest Datastore?
Re: Fastest Datastore?
- Subject: Re: Fastest Datastore?
- From: Greg Herlihy <email@hidden>
- Date: Sun, 05 Mar 2006 20:17:52 -0800
- Thread-topic: Fastest Datastore?
I may be misreading the Core Data documentation, but the Core Data
Programming Guide seems to suggest that it is OK for an application to
override the primitive accessor routines:
"...If for an attribute attributeName you implement primitiveAttributeName
and setPrimitiveAttributeName:, then Core Data will use these methods in
place of primitiveValueForKey:@"attributeName" and
setPrimitiveValueForKey:@"attributeName"."
"Primitive accessor methods are useful if you want custom methods to provide
direct access to instance variables for persistent Core Data properties,
although typically there should be little reason to implement them. The
example below contrasts public and primitive accessor methods for an
attribute, int16, of type Integer 16, stored in a custom instance variable,
_int16RnadmText."
And, as mentioned in the above paragraph, a source listing is also provided
that shows how to override the primitive accessor routines.
Greg
On 3/5/06 6:36 PM, "mmalcolm crawford" <email@hidden> wrote:
>
> On Mar 5, 2006, at 4:36 PM, Greg Herlihy wrote:
>
>> In fact there are two Core Data routines: -primitive<Key> and
>> setPrimitive<Key> that would be ideal places to intercept data to
>> and from the data store.
>
> No, you should *not* override these methods:
> <http://developer.apple.com/documentation/Cocoa/Reference/
> CoreData_ObjC/Classes/NSManagedObject.html#//apple_ref/occ/instm/
> NSManagedObject/primitiveValueForKey:>
>
> You can instead follow the pattern described in <http://
> developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/
> cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW5> or <http://
> developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/
> cdNSAttributes.html>.
>
> 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
_______________________________________________
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