Re: setValue:forKey: and to-many relationships
Re: setValue:forKey: and to-many relationships
- Subject: Re: setValue:forKey: and to-many relationships
- From: Joanna Carter <email@hidden>
- Date: Fri, 23 Apr 2010 11:30:02 +0100
Hi Christian
> I would like to step in here for a related question. Is there any way to get rid of the compiler warnings if you use the generated accessors without writing a subclass of NSManagedObject and adding properties and method declarations?
Normally, generating a subclass also generates a category that declares the necessary methods:
@interface One (CoreDataGeneratedAccessors)
- (void)addManyObject:(NSManagedObject *)value;
- (void)removeManyObject:(NSManagedObject *)value;
- (void)addMany:(NSSet *)value;
- (void)removeMany:(NSSet *)value;
@end
If you didn't want to generate a specific class, you can always write a category on NSManagedObject:
@interface NSManagedObject (CoreDataGeneratedAccessors)
- (void)addManyObject:(NSManagedObject *)value;
- (void)removeManyObject:(NSManagedObject *)value;
- (void)addMany:(NSSet *)value;
- (void)removeMany:(NSSet *)value;
@end
Joanna
--
Joanna Carter
Carter Consulting
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden