diff --git a/mogenerator.h b/mogenerator.h index 2e33094b..1d5761d8 100644 --- a/mogenerator.h +++ b/mogenerator.h @@ -32,12 +32,14 @@ @interface NSAttributeDescription (typing) - (BOOL)hasScalarAttributeType; - (BOOL)usesScalarAttributeType; +- (BOOL)usesCustomScalarAttributeType; - (NSString*)scalarAttributeType; - (NSString*)scalarAccessorMethodName; - (NSString*)scalarFactoryMethodName; - (BOOL)hasDefinedAttributeType; - (NSArray*)objectAttributeTransformableProtocols; - (BOOL)hasAttributeTransformableProtocols; +- (BOOL)usesCustomObjectAttributeType; - (NSString*)objectAttributeClassName; - (NSString*)objectAttributeType; - (BOOL)hasTransformableAttributeType; diff --git a/mogenerator.m b/mogenerator.m index 4533f987..63d8ae1a 100644 --- a/mogenerator.m +++ b/mogenerator.m @@ -443,6 +443,11 @@ - (BOOL)usesScalarAttributeType { } } +- (BOOL)usesCustomScalarAttributeType { + NSString *attributeValueScalarType = [[self userInfo] objectForKey:kAttributeValueScalarTypeKey]; + return (attributeValueScalarType != nil); +} + - (NSString*)scalarAttributeType { BOOL isUnsigned = [self isUnsigned]; @@ -603,6 +608,12 @@ - (NSArray*)objectAttributeTransformableProtocols { - (BOOL)hasAttributeTransformableProtocols { return [self hasTransformableAttributeType] && [[self userInfo] objectForKey:@"attributeTransformableProtocols"]; } + +- (BOOL)usesCustomObjectAttributeType { + NSString *attributeValueClassName = [[self userInfo] objectForKey:@"attributeValueClassName"]; + return (attributeValueClassName != nil); +} + - (NSString*)objectAttributeType { NSString *result = [self objectAttributeClassName]; if ([result isEqualToString:@"Class"]) {