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 ?
views:
107answers:
1
A:
Use the transformable attribute, but no transformer. Then, handle the transformation manually.
gerry3
2010-02-13 20:26:22
What (then) would be the difference between the transformable field and a binary data field holding the NSData directly?
Andiih
2010-02-13 20:59:15
Not sure. Does it matter? Manually managing the image data will allow you to get that performance gain on those rare occasions.
gerry3
2010-02-14 19:14:42
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
2010-02-15 12:00:03