You're already compressing the image. When you call UIImagePNGRepresentation
, you get a PNG-style compressed image file.
You didn't post the details of your data model, but at a minimum, make sure that the picdata
attribute is configured to use external storage in the model editor. Do that first.
If that doesn't help, there are other approaches to reducing the impact of binary blobs on Core Data. But those are not the next step. You specifically mention slowness rather than memory problems, and problems with Core Data and images are far more likely to cause memory issues. Rather than worry about image handling when you have a speed problem, use Instruments to profile your app. You'll find out exactly where it's slowing down.