I gave a talk on Core Data in a Nutshell and its concurrency rules.
Core Data Fundamentals
Core Data Vs Developers
Core Data Stack
• Like a scratchpad
• fetch, change, add and delete
• Create more than one contexts
• Updates persistent store
(application’s main queue)
• asynchronous method
• gets wrapped in a autorelease pool.
• synchronous method
• will block the calling thread
• does not wrap the block in an
• A managed object context is tied to a serial queue.
• Create only two contexts for simplicity.
• Concurrency types are two but contexts can be many.
• Context executes on a “private” queue.
• Performance heavy operations should be performed on the background queue.
• Don’t pass NSManagedObject instances between queues.
• To avoid unnecessary saves, be aware of automatically triggered broadcasts.