|
June 22, 2016
Core Data is Apple’s data storage framework: it’s powerful, built-in, and can integrate with iCloud. If you're working in iOS, you need this. Now available in both Swift language (pragprog.com/book/mzswift) and Objective-C (pragprog.com/book/mzcd3) editions.
And for today's reading pleasure, here are five Core Data tips from author Marcus Zarra:
In a multi-threaded environment, always turn on the:
-com.apple.CoreData.ConcurrencyDebug 1
setting when you are running in debug mode. This will catch threading errors during development.
Only use one NSManagedObjectContext for your entire User Interface. The User Interface is designed to run on a single thread and therefore using additional NSManagedObjectContext instances is unnecessary and creates problems.
If you are using the parent/child design with Core Data, do not try and reuse child NSManagedObjectContext instances. They are cheap and meant to be thrown away after a single use.
Every time you ship your application with a model change, tag that commit in your version control system so that if the model accidentally gets altered you can quickly find the original.
Every "error" that Core Data can potentially produce is a developer preventable error. If you treat them as hard errors (with a call to abort, for example) you will be able to test for them more easily and your error handling code becomes far less complex.
Come and get 'em!
Core Data in Swift: Data Storage and Management for iOS and OS X
Core Data expert Marcus Zarra walks you through a fully developed application based around the Core Data APIs. You'll build on this application throughout the book, learning key Core Data elements such as NSPredicate, NSFetchRequest, thread management, and memory management.
Start with the basics of Core Data and learn how to use it to develop your application. Then delve deep into the API details. Explore how to get Core Data integrated into your application properly, and work with this flexible API to create convenience methods to improve your application's maintainability. Reduce your migration difficulties, integrate your Core Data app with iCloud and Watch Kit, and use Core Data in a queue-based environment. By the end of the book, you'll have built a full-featured application, gained a complete understanding of Core Data, and learned how to integrate your application into the iPhone/iPad platform.
This book is based on Core Data in Objective-C, Third Edition. It focuses on Swift and adds an additional chapter on how to integrate Core Data with an efficient network implementation, with best practices on how to load and pre-load data into your Swift application.
Now in print and shipping from pragprog.com/book/mzswift.
Core Data in Objective-C, Third Edition: Data Storage and Management for iOS and OS X
This third edition updates all examples for OS X El Capitan and iOS 9, and gets you up to speed on changes in multithreading and batch processing. There's a new chapter on efficiently importing data from a network location, and a new discussion of how best to pre-load data into your application.
Now in print and shipping from pragprog.com/book/mzcd3.
Did You Know?
You can synch your ebooks amongst your devices via Dropbox, including updates! Just login to your account on pragprog.com, edit your profile, and connect your dropbox account. See our FAQ for details.
Don't Get Left Out
Are your friends jealous that you get these spiffy email newsletters and they don't? Clue them in that all they need to do is create an account on pragprog.com (email address and password is all it takes) and select the checkbox to receive newsletters.
Are you following us on Twitter and/or Facebook? Here's where you can find us and keep up with the latest news and commentary, and occasional discounts:
Tell your friends! Tweet this
Follow us on Twitter: @pragprog, @pragpub, Andy Hunt @PragmaticAndy.
Andy Hunt
Publisher, Pragmatic Bookshelf
Books • eBooks • PragPub Magazine • Audiobooks and Screencasts PragProg.com
Manage your subscription using your account, or permanently unsubscribe here. Sent by the Pragmatic Programmers, LLC. • 9650 Strickland Rd Ste 103-255• Raleigh NC 27615
|