SlideShare a Scribd company logo
Core Data
Changes in iOS10
G. Abhisek
• Core Data Concepts.
• Changes in Core Data.
Contents:
• What is Core Data?
• Core Data Stack:
Managed Object Model
Persistent Store Coordinator
Managed Object Contexts
Core Data Concepts
What is Core Data?
• Its not a database.
• Its a framework - Manages model layer objects in
application.
• Three types of files are generated when core data for an
application is enabled :
- .sqlite (Database file)
- .sqlite-shm (Shared Memory)
- .sqlite-wal (Write ahead log)
Core Data Stack
• Managed Object Model - Data model of application.
• Persistent Store Co-ordinator - The one which persists
our data in the database.
• Managed Object Context - Collection of model objects.
Core data ios10changes
Core Data Changes
• Persistent Containers
• Query Generations
• Concurrency Improvements
Persistent Containers
• It creates a managed object model, and a managed object
context.
• Provides several properties and methods to interact with
the Core Data stack.
• Provides a description about the persistent store, its
configuration, and whether it is a read-only persistent
store.
• Initialise Persistent Store Container:
let persistentContainer = NSPersistentContainer(name: "MyApplication")
• Get the description of Persistent store:
let persistentStoreDescription = NSPersistentStoreDescription(url: url)
• Add Persistent Store to Persistent Store Coordinator

Faulting
• When we fetch any entity from from Core Data database,
we are returned back with not a fully initialised managed
object, if its not required, rather it returns a kind of
placeholder for the particular managed object’s instance.
• When faults are inaccessible or faults are not fulfilled, we
encounter an exception (crash in iOS8 & exception iOS9)
• Resolve this issue by:
Setting shouldDeleteInaccessibleFaults to proper value.
Query Generations
• As of iOS 10 & 10.2, assigns a query generation to a
managed object context.
• It means it interacts with a snapshot of the data stored in
the persistent store.
• Any changes in the data base won’t affect the snapshot
thereby avoiding a possible case of faults.
Concurrency Improvements
• Earlier to iOS10, Persistent Stores locked themselves if
different contexts accessed them from different threads,
which results in performance issues, and slower Core
Data procedures.
• As of iOS 10, the persistent store is not allowed to lock
itself away, and the query is directly moved to the SQLite
database.
Thank You

More Related Content

PPTX
SQLite - Overview
PPTX
A brief introduction to SQLite PPT
PDF
SQL Server 2019 Data Virtualization
PPTX
Stretch Database
PPTX
Database synchronization prashant parit
PPTX
Always encrypted overview
PDF
Sql Server 2016 Always Encrypted
PPTX
Study of SQLite
SQLite - Overview
A brief introduction to SQLite PPT
SQL Server 2019 Data Virtualization
Stretch Database
Database synchronization prashant parit
Always encrypted overview
Sql Server 2016 Always Encrypted
Study of SQLite

What's hot (20)

PDF
Stretch db sql server 2016 (sn0028)
PPTX
Partially Contained Databases in SQL Server 2012+
PDF
Microsoft SQL Family and GDPR
PPTX
Query Store and live Query Statistics
DOC
Sql server-dba
PPT
Entity Framework Overview
PDF
Dynamic data masking sql server 2016
PPTX
Microsoft SQL Server 2008
PDF
Modernizing your database with SQL Server 2019
PDF
Row level security
PDF
Implementing Mobile Reports in SQL Sserver 2016 Reporting Services
PPTX
SSIS by Anjali
DOCX
Android project (1)
DOC
Assignment_4
PDF
Ssn0020 ssis 2012 for beginners
PPTX
Partially Contained Databases
PPT
MySQL ppt
PPTX
AcceleTest
PPSX
Provisioning Azure Virtual Machines to run SQL Server
KEY
I os webkit sq-lite - ios 5.1 bug en
Stretch db sql server 2016 (sn0028)
Partially Contained Databases in SQL Server 2012+
Microsoft SQL Family and GDPR
Query Store and live Query Statistics
Sql server-dba
Entity Framework Overview
Dynamic data masking sql server 2016
Microsoft SQL Server 2008
Modernizing your database with SQL Server 2019
Row level security
Implementing Mobile Reports in SQL Sserver 2016 Reporting Services
SSIS by Anjali
Android project (1)
Assignment_4
Ssn0020 ssis 2012 for beginners
Partially Contained Databases
MySQL ppt
AcceleTest
Provisioning Azure Virtual Machines to run SQL Server
I os webkit sq-lite - ios 5.1 bug en
Ad

Similar to Core data ios10changes (20)

PDF
Intro to Core Data
PDF
CoreData
PDF
Infinum iOS Talks S01E02 - Things every iOS developer should know about Core ...
PDF
Core data WIPJam workshop @ MWC'14
PDF
CoreData Best Practices (2021)
PPT
Core data orlando i os dev group
PDF
CoreData - there is an ORM you can like!
PDF
Qardio experience with Core Data
PDF
Core Data
PDF
Core data intermediate Workshop at NSSpain 2013
PDF
Mashup iOS - Core data
PDF
Mobile Open Day: Things I wish I'd known about Core Data before getting married
PDF
Core data basic Workshop slides NSSpain 2013
PDF
Core data in Swfit
PDF
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
PPTX
A CoreData Journey
PDF
Advanced Core Data - The Things You Thought You Could Ignore
PDF
Core Data Introduction
PDF
Adventures in Multithreaded Core Data
PPTX
Introduction to Core Data - Jason Shapiro
Intro to Core Data
CoreData
Infinum iOS Talks S01E02 - Things every iOS developer should know about Core ...
Core data WIPJam workshop @ MWC'14
CoreData Best Practices (2021)
Core data orlando i os dev group
CoreData - there is an ORM you can like!
Qardio experience with Core Data
Core Data
Core data intermediate Workshop at NSSpain 2013
Mashup iOS - Core data
Mobile Open Day: Things I wish I'd known about Core Data before getting married
Core data basic Workshop slides NSSpain 2013
Core data in Swfit
CocoaHeads PDX 2014 01 23 : CoreData and iCloud Improvements iOS7 / OSX Maver...
A CoreData Journey
Advanced Core Data - The Things You Thought You Could Ignore
Core Data Introduction
Adventures in Multithreaded Core Data
Introduction to Core Data - Jason Shapiro
Ad

Recently uploaded (20)

PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
Geodesy 1.pptx...............................................
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPT
Project quality management in manufacturing
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Welding lecture in detail for understanding
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
composite construction of structures.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Operating System & Kernel Study Guide-1 - converted.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Mechanical Engineering MATERIALS Selection
Lesson 3_Tessellation.pptx finite Mathematics
Geodesy 1.pptx...............................................
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Project quality management in manufacturing
Lecture Notes Electrical Wiring System Components
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Welding lecture in detail for understanding
Structs to JSON How Go Powers REST APIs.pdf
Foundation to blockchain - A guide to Blockchain Tech
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
composite construction of structures.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk

Core data ios10changes

  • 1. Core Data Changes in iOS10 G. Abhisek
  • 2. • Core Data Concepts. • Changes in Core Data. Contents:
  • 3. • What is Core Data? • Core Data Stack: Managed Object Model Persistent Store Coordinator Managed Object Contexts Core Data Concepts
  • 4. What is Core Data? • Its not a database. • Its a framework - Manages model layer objects in application. • Three types of files are generated when core data for an application is enabled : - .sqlite (Database file) - .sqlite-shm (Shared Memory) - .sqlite-wal (Write ahead log)
  • 5. Core Data Stack • Managed Object Model - Data model of application. • Persistent Store Co-ordinator - The one which persists our data in the database. • Managed Object Context - Collection of model objects.
  • 7. Core Data Changes • Persistent Containers • Query Generations • Concurrency Improvements
  • 8. Persistent Containers • It creates a managed object model, and a managed object context. • Provides several properties and methods to interact with the Core Data stack. • Provides a description about the persistent store, its configuration, and whether it is a read-only persistent store.
  • 9. • Initialise Persistent Store Container: let persistentContainer = NSPersistentContainer(name: "MyApplication") • Get the description of Persistent store: let persistentStoreDescription = NSPersistentStoreDescription(url: url) • Add Persistent Store to Persistent Store Coordinator

  • 10. Faulting • When we fetch any entity from from Core Data database, we are returned back with not a fully initialised managed object, if its not required, rather it returns a kind of placeholder for the particular managed object’s instance. • When faults are inaccessible or faults are not fulfilled, we encounter an exception (crash in iOS8 & exception iOS9) • Resolve this issue by: Setting shouldDeleteInaccessibleFaults to proper value.
  • 11. Query Generations • As of iOS 10 & 10.2, assigns a query generation to a managed object context. • It means it interacts with a snapshot of the data stored in the persistent store. • Any changes in the data base won’t affect the snapshot thereby avoiding a possible case of faults.
  • 12. Concurrency Improvements • Earlier to iOS10, Persistent Stores locked themselves if different contexts accessed them from different threads, which results in performance issues, and slower Core Data procedures. • As of iOS 10, the persistent store is not allowed to lock itself away, and the query is directly moved to the SQLite database.