Your SlideShare is downloading. ×
A CoreData Journey
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

A CoreData Journey

146
views

Published on

A CoreData Journey, presentation given at CodeCamp on 10 Mai 2014.

A CoreData Journey, presentation given at CodeCamp on 10 Mai 2014.

Published in: Mobile, Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
146
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. A Core Data Journey
  • 2. Who Am I? • Alex Terente • Mainly iOS developer • Consultant and working @ TAGonSoft • alex.terente@TAGonSoft.ro
  • 3. What is Core Data? “The Core Data framework provides generalized and automated solutions to common tasks associated with object life- cycle and object graph management, including persistence.”
  • 4. What is Core Data? • Allows definition of Managed Objects • Functionality to create, update, delete, query • Multiple back-end storage options
  • 5. Storage Options • Binary • In-memory • XML • Not available on the iPhone • SQLite • Only option that does not require the entire store to reside in memory
  • 6. What is not Core Data • Core Data is not a relational database or a relational database management system • Core Data is not a silver bullet.
  • 7. Core Data vs. SQLite SQLite Core Data Bulk/Set Operations Yes No Automatic object population No Yes Custom SQL Yes No Select only certain fields Yes No Automated Migrations No Yes Less Complex Code No Yes
  • 8. Interface to Core Data NSPersistentStore NSPersistentStoreCoordinator NSManagedObjectContext
  • 9. NSPersistentStoreCoordinat or
  • 10. NSManagedObjectModel
  • 11. Model Demo
  • 12. NSManagedObjectConte xt
  • 13. Inserting an Object
  • 14. Querying for Objects
  • 15. Deleting an Object
  • 16. Updating an Object • Same as insert • Make changes followed by ManagedObjectContext save
  • 17. Save Context
  • 18. Code Demo
  • 19. Migration • Lightweight Migration • Model versioning
  • 20. Lightweight migration • Adding or removing entity, relation or attribute • Making attribute non optional • Making non optional attribute optional • Renaming an atribute or entity
  • 21. Lightweight migration
  • 22. Model Versioning
  • 23. Model Versioning
  • 24. Model Versioning
  • 25. Code Demo
  • 26. Threading • Must create a new NSManagedObjectContext for each thread • NSManagedObjects are associated with a particular context • NSManagedObjectContext can be updated with changes from other contexts
  • 27. Code Demo
  • 28. Core Data and iCloud • Enabling • Add iCloud Persistent Store
  • 29. Enabling iCloud
  • 30. Enabling iCloud
  • 31. iCloud Persistent Store
  • 32. Resources • Core Data Programming Guide • Core Data Model Versioning and Data Migration • iCloud Programming Guide for Core Data • iCloud Design Guide • Code Sample https://github.com/TAGonSoft/CoreD ata_CodeCamp
  • 33. Q & A
  • 34. Thank You Please feel the evaluation form A Core Data Journey Alex Terente TAGonSoft.com