views:

19

answers:

1

The data modeler generated this class for me:

@interface Cat :  NSManagedObject  
{
}

@property (nonatomic, retain) NSSet* event;

@end


@interface Cat (CoreDataGeneratedAccessors)
- (void)addEventObject:(NSManagedObject *)value;
- (void)removeEventObject:(NSManagedObject *)value;
- (void)addEvent:(NSSet *)value;
- (void)removeEvent:(NSSet *)value;

@end

what I see there is: It declares an category on Cat, but with no implementation in the .m file. So is this an "informal protocol"? I thought they're bad (for whatever reason). Why's the compiler not complaining that the implementation is missing for these methods?

+3  A: 

Core Data is magic.

More seriously, these methods are generated at runtime by core data, they're declared in your .h file simply to remove compiler warnings.

NB If someone else knows a more complete answer, please message me and tell me more!

deanWombourne
NB if someone else knows a more complete answer, post it here for everyone ;)
dontWatchMyProfile
That sounds accurate. You missed something though: the compiler *does* warn you if you write `@implementation Cat (CoreDataGeneratedAccessors)`.
tc.