Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Summary

This chapter offered just a taste of Core Data’s capabilities. These recipes showed you how to design and implement basic Core Data applications. They used Core Data features to work with its managed object models. You read about defining a model and implementing fetch requests. You saw how to add objects, delete them, modify them, and save them. You learned about predicates and undo operations, and discovered how to integrate Core Data with table views. After reading through this chapter, here are a few final thoughts to take away with you:

  • Xcode issues a standard compiler warning when it encounters relationships that are not reciprocal. Nonreciprocal relationships add an extra layer of work, preventing you from taking advantage of simple delete rules such as Nullify. Avoid these relationships when possible.

  • When moving data from a pre–Core Data store (for example, from object archives or flat text files) into a new database, be sure to use some sort of flag in your user defaults. Check whether you’ve already performed a data upgrade. You want to migrate user data once when the application is upgraded but not thereafter.

  • Predicates are one of my favorite SDK features. Spend some time learning how to construct them and use them with all kinds of objects such as arrays and sets, not just with Core Data.

  • If you’re not using Core Data with tables, you’re missing out on some of the most elegant ways to populate and control your tabular data.

  • iCloud provides the perfect match between Core Data and ubiquitous data, extending iOS data to the user’s desktop, to each of his or her devices, and to the cloud as a whole. Look up UIManagedDocument to learn more about iCloud and Core Data integration.

  • Core Data’s capabilities go way beyond the basic recipes you’ve seen in this chapter. Check out Tim Isted and Tom Harrington’s Core Data for iOS: Developing Data-Driven Applications for the iPad, iPhone, and iPod touch, available from Pearson Education/InformIT/Addison-Wesley for an in-depth exploration of Core Data and its features.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial