Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, as Gilbert pointed out, example code is not meant for production use and will be slow.</p> <p>Second, you should not store images in Core Data.  The example may show how to do it but it is generally a <em>very bad idea</em>.  You should be storing images on disk and then keeping a pointer (file path) to the image in Core Data.  There are some exceptions to this rule (very small images) but you should rethink your design.</p> <p>Lastly, A lot of the slowness you are seeing may not be Core Data related.  The image picker code is very slow on its own.  I would recommend changing the code to just write to disk and see how slow that is compared to the writing to Core Data.  I would be surprised if it was much faster.</p> <h2>Update</h2> <p>You can store small images inside of Core Data and my advice from other posts stands, mores for the desktop than iOS.  The reason for this is the cache.  On iOS, the cache that Core Data uses is very small.  If you store images in the database that are large, you can blow out that cache easily and cause future calls that should be in the cache to hit the disk instead.  This is not a hard and fast rule of "don't store binary data" but more of a rule of watch your performance and if you are hitting the disk more than you should, binary data could easily be the cause.</p> <h2>Contacts</h2> <p>With regard to contacts, you can be slower because they are doing things differently than you are and they could easily be using private APIs to access the camera.  Because it is Apple, they don't necessarily play by the same rules as us.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload