Skip to Main Content
Core Data in Objective-C, 3rd Edition
book

Core Data in Objective-C, 3rd Edition

by Marcus S. Zarra
June 2016
Beginner to intermediate content levelBeginner to intermediate
240 pages
6h 17m
English
Pragmatic Bookshelf
Content preview from Core Data in Objective-C, 3rd Edition

The DocumentPreferences Object

To build a system that imitates the NSUserDefaults, we need to have a single object that manages the parameters table for us. By doing so, we can treat the entire parameters table as if it were a single object with a dynamic number of accessors. However, we don’t want to have to write an accessor every time that we add a parameter; ideally, we want to just call ‑valueForKey: and ‑setValue:forKey: and not worry about the persistence of these values. Lastly, we want to be able to set up some default values.

An important point about the defaults is that they aren’t persisted to disk. If they get persisted, then later versions that change the default would require additional code to check for persisted defaults and ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

iOS Programming Cookbook

iOS Programming Cookbook

Hossam Ghareeb
Learning Cocoa with Objective-C, 4th Edition

Learning Cocoa with Objective-C, 4th Edition

Paris Buttfield-Addison, Jonathon Manning, Tim Nugent

Publisher Resources

ISBN: 9781680502022Errata Page