Subclassing NSManagedObject
Subclassing NSManagedObject
- Subject: Subclassing NSManagedObject
- From: T Reaves <email@hidden>
- Date: Sun, 22 May 2005 18:01:02 -0400
For my accessors & mutators, do I really need to go through all
the steps as outlined in Apple's docs? If they are simple accessors
& mutators, can I do
- (NSString *)name
{
return [self valueForKey:@"name"];
}
- (void)setName:(NSString *)newName
{
[self setValue:newName forKey:@"name"];
}
instead of:
- (NSString *)name
{
[self willAccessValueForKey:@"name"];
NSString *n = [self primitiveValueForKey:@"name"];
[self didAccessValueForKey:@"name"];
return n;
}
- (void)setName:(NSString *)newName
{
[self willChangeValueForKey:@"name"];
[self setPrimitiveValue:newName forKey:@"name"];
[self didChangeValueForKey:@"name"];
}
_______________________________________________
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