I'm working with NSImage
's and want to store them in a Core Data
binary object. I got things working, but I read a lot of different ways that are using NSImageRep
to do this. Currently I'm doing the following:
Creating binary data from an image
- (NSData *)createBinaryWithImage:(NSImage *)image {
return [image TIFFRepresentation];
}
Creating an image from binary data
- (NSImage *)createImageWithBinaryData:(NSData *)binaryData {
return [[NSImage alloc] initWithData:binaryData];
}
Is this an acceptable and valid way or is there a better way ?