CBLIncrementalStore and attachments

Hello there, 

To manage the attachments, it must be binary types. 
I found another solution to manage attachments in CBLIncrementalStore because the binary involves a lot of changes in my code. 

I'd like your opinion. 

I created a xcdatamodeID with entitie with image transformable attribute type. 
I changed CBLIncrementalstore to manage the new one. 

Instead of using NSBinaryDataAttributeType I used isStoredInExternalRecord. 

The result: 
any attribute can be a attachments by checking isStoredInExternalRecord 
You can choose to store the binary internally or externally 

Sample Code to add when you have a transformable type.

@implementation ImageToDataTransformer

+ (BOOL)allowsReverseTransformation {

   return YES;

}

+ (Class)transformedValueClass {

   return [NSData class];

}

- (id)transformedValue:(id)value {

    NSBitmapImageRep *imgRep = [[value representations] objectAtIndex: 0];

    NSData *data = [imgRep representationUsingType: NSPNGFileType properties: nil];

   return data;

}

- (id)reverseTransformedValue:(id)value {

   NSImage *image = [[NSImage alloc] initWithData:value];

   return image;

}

@end