0

on my app I get images from photos library and device camera and store it into an array.

I’d like to save this array in a CoreData object can I ? Does in need to use transformable ? How to save and how to get after save ?

Cydiaddict
  • 277
  • 4
  • 17
  • I believe the most common advice is to store the images separately and then store links to the images in Core Data, you should be able to find several similar questions here at stackoverflow to help you – Joakim Danielson May 26 '19 at 14:37
  • That looks more diffiy – Cydiaddict May 26 '19 at 14:44
  • You can store images in core data, see [this post](https://stackoverflow.com/a/1601546/1987726). You just have to set the attribute type as transformable. This requires that your images can be transformed to a Data (or NSData) instance and back. – Reinhard Männer May 26 '19 at 15:16
  • So how I can store an array of images. – Cydiaddict May 26 '19 at 15:42
  • If the images are available anyway on the device save only references (URL , UUID or other identifiers). Storing `UI/NSImage` instances in Core Data is very bad practice. – vadian May 26 '19 at 16:44
  • The idea is to click on a UICollecion View cell, présent an action sheet with this 2 actions : scan a document, use photo library. The collection View can fountains as photos as you want. All this UIImage are save in a array. So I want to save that array of images in my “schoolTest” core data object. So how can I do that directly ? – Cydiaddict May 26 '19 at 18:46

0 Answers0