Implementing custom accessors in core data
Implementing custom accessors in core data
- Subject: Implementing custom accessors in core data
- From: Knud Möller <email@hidden>
- Date: Wed, 18 Jan 2006 14:25:39 +0000
Hi,
I understand that, if I don't want to write my own custom accessors
for core data, I use valueForKey: and setValueForKey: (for
attributes) or manipulate the result of mutableSetValueForKey: (for
relations). Now, the core data programming guide gives detailed
information on how to implement custom accessors if needed (basically
calling the relevant KVO methods). I wonder: why can't I just
implement convenience accessor methods like this:
- (NSString *)name
{
return [self valueForKey: @"name"];
}
- (void)setName: (NSString *)name
{
[self setValue: name forKey: @name];
}
Would this work? Or does the existence of custom accessors prevent
the valueForKey/setValueForKey methods from working properly?
If this has been answered before, my apologies.
Cheers,
Knud
-------------------------------------------------
Knud Möller, MA
+353 - 91 - 495086
Digital Enterprise Research Institute
National University of Ireland, Galway
Institiúid Taighde na Fiontraíochta Digití
Ollscoil na hÉireann, Gaillimh
_______________________________________________
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