I know “I should not store large files in core data and it is better to save them in the file system”.
But…
I still wish to try this out as my sound files are between 5-20 kb each and to my needs it will be great if they will be in core data. to be a extra careful I will store them in a different entity.
Now!
- Do i have to use binary data or can I use transformable object? if i can, i will be happy know how?
- still, why would’t you do it even with such small files?
Using a transformer really depends on what object you want to transform the sound data into.
Apple has example code for a UIImage transformer.
Keep in mind that the transformer is called each time the object is fetched, so the overhead should be kept to a minimum. You probably wouldn’t want to instantiate an AVAudioPlayer for each object every time the UITableViewController fetches an object to draw a cell, for example.