Under the Hood

Now that we’ve looked at how to integrate iCloud into our Core Data–based application, it’s helpful to understand exactly how it works under the hood.

Debug Output

Core Data has several logging levels that we can turn on to watch all of the SQL calls that are generated during an application’s life cycle. There are currently three levels to this debugging log, with level 1 being the least chatty and level 3 being the most chatty. We can set this debug output by adding the runtime parameter com.apple.CoreData.SQLDebug to our application and pass along with it the level we want to be set.

In addition to the Core Data debug setting, we can turn on an additional setting to watch all of the chatter between Core Data and iCloud. That ...

Get Core Data in Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.