You can use the NSEntityDescription
and NSPropertyDescription
APIs to determine the kind of a modelled entity.
I would enumerate through NSAttributeDescription
's NSAttributeType
constants
switch (thisAttribute.attributeType) {
case NSInteger16AttributeType: { /* do something */; } break;
case NSDecimalAttributeType : { /* do something */; } break;
case NSStringAttributeType : { /* do something */; } break;
case NSBooleanAttributeType : { /* do something */; } break;
// etc
default: break;
}