diff --git a/mogenerator.m b/mogenerator.m index d8213a4a..6104155a 100644 --- a/mogenerator.m +++ b/mogenerator.m @@ -57,6 +57,17 @@ - (NSArray*)entitiesWithACustomSubclassVerbose:(BOOL)verbose_ { @end +@implementation NSArray (countKeyValueCoding) + +- (id)valueForKey:(NSString *)key { + + if ([key isEqualToString:@"count"]) + return [NSNumber numberWithUnsignedInteger:[self count]]; + + return [super valueForKey:key]; +} +@end + @implementation NSEntityDescription (customBaseClass) - (BOOL)hasCustomSuperentity { NSEntityDescription *superentity = [self superentity];