You can watch this episode by subscribing to Cocoacasts Plus.
Seeding a Core Data Persistent Store
Loading Seed Data From a File
1 | Three Strategies 05:11 |
---|---|
2 | Hard-Coding Seed Data 09:52 |
3 | Seeding Data Asynchronously 08:34 |
4 | Avoiding Duplicates 08:12 |
5 | Loading Seed Data From a File 08:21 |
6 | Loading Seed Data From a Remote Server 05:45 |
Hard-coding seed data is quick and easy, but it's not my preferred solution. Loading seed data from a file is a strategy I like more. The idea is simple. You include a file with seed data in the application bundle. The file is loaded at runtime and its contents parsed. The contents is used to seed the persistent store with data.
Instant and Unlimited Access
to 500+ Cocoacasts Tutorials
Monthly
$19 / month
Pay Once a Month
30 Day Money Back Guarantee
Yearly
$8.25 / month (billed annually)
Pay Once a Year and Save $129
30 Day Money Back
Guarantee