views:

107

answers:

1

I have an image field of type transformable and a typical ImageToDataTransformer class. 99% of the time that's perfect and great shortcut, but just occasionally I find myself transforming the managed object back to NSData (knowing that if it wasn't for the ImageToDataTransformer I would have got NSData in the first place). As these operations are fairly expensive on an iPhone, is there a way of avoiding the transformer on the rare occasions I just want the NSdata ?

A: 

Use the transformable attribute, but no transformer. Then, handle the transformation manually.

gerry3
What (then) would be the difference between the transformable field and a binary data field holding the NSData directly?
Andiih
Not sure. Does it matter? Manually managing the image data will allow you to get that performance gain on those rare occasions.
gerry3
Only in so far as I was having issue with image storage as binary. Random crashes but nothing I could figure out. I switched to the transformable and transformers and its been solid. All I really did was change the type, and move my manual transformations into a transformer. Sounds like I have to try going half way back :-)
Andiih