开发者

What kind of category is this and where's the implementation?

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 th开发者_运维问答ey're bad (for whatever reason). Why's the compiler not complaining that the implementation is missing for these methods?


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜