Background Save
Because the excessive memory usage issues were resolved in Chapter 10, the Prepare and Shop table views now display nil
thumbnails. The process to create thumbnail images dynamically will be an intensive one, so it should be performed in the background to prevent impact on the user interface. To support the process of thumbnail creation, background save will be implemented first. The easiest way to achieve background save is to use two contexts in a parent and child hierarchy. The background context, referred to as the _parentContext
, will be configured to use a private queue by setting its concurrency type to NSPrivateQueueConcurrencyType
. The foreground context that underpins the user interface is referred to as _context
. It ...
Get Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.