# Core Data

Published articles for Core Data.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Response: The Laws of Core Data

DevFeed: [Response: The Laws of Core Data](<https://devfeed.tech/articles/response-the-laws-of-core-data-37512.md>)

Original publisher: [Read original article](<https://www.cimgf.com/2018/05/10/response-the-laws-of-core-data/>)

Author: Marcus Zarra

Published: 2018-05-10T21:39:50Z

Content type: opinion

Language: en

Sources: [Cocoa Is My Girlfriend](<https://devfeed.tech/sources/cocoa-is-my-girlfriend.md>)

Topics: [Persistence](<https://devfeed.tech/topics/persistence.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>)

Tags: [asynchronous](<https://devfeed.tech/tags/asynchronous.md>), [controllers](<https://devfeed.tech/tags/controllers.md>), [core-data](<https://devfeed.tech/tags/core-data.md>), [data](<https://devfeed.tech/tags/data.md>), [main-thread](<https://devfeed.tech/tags/main-thread.md>), [migrations](<https://devfeed.tech/tags/migrations.md>), [network](<https://devfeed.tech/tags/network.md>), [persistence](<https://devfeed.tech/tags/persistence.md>), [threads](<https://devfeed.tech/tags/threads.md>)

### AI overview

The author responds to another developer's proposed laws of Core Data, agreeing that Core Data should be treated as an object model rather than a database or thin SQLite wrapper. The article argues for encapsulating the persistence stack, using contexts only on their assigned queues, treating managed objects as data objects, and using parent-child contexts when working with external systems such as networks or imports and exports.

### Source excerpt

Recently, I saw a post from Dave DeLong and knowing his history with the framework I read it with extreme curiosity. Unfortunately, that read led to this post as I disagree strongly with a number of the laws he has laid down. Since I know people are going to be asking me about this post [...]

## Leaving MartianCraft and Offering iOS Networking and Core Data Consulting

DevFeed: [Leaving MartianCraft and Offering iOS Networking and Core Data Consulting](<https://devfeed.tech/articles/the-next-chapter-37507.md>)

Original publisher: [Read original article](<https://www.cimgf.com/2015/08/04/the-next-chapter/>)

Author: Marcus Zarra

Published: 2015-08-04T15:05:54Z

Content type: opinion

Language: en

Sources: [Cocoa Is My Girlfriend](<https://devfeed.tech/sources/cocoa-is-my-girlfriend.md>)

Topics: [Development](<https://devfeed.tech/topics/development.md>), [networking](<https://devfeed.tech/topics/networking.md>), [Persistence](<https://devfeed.tech/topics/persistence.md>), [iOS](<https://devfeed.tech/topics/ios.md>)

Tags: [announcement](<https://devfeed.tech/tags/announcement.md>), [consulting](<https://devfeed.tech/tags/consulting.md>), [core-data](<https://devfeed.tech/tags/core-data.md>), [development](<https://devfeed.tech/tags/development.md>), [ios](<https://devfeed.tech/tags/ios.md>), [networking](<https://devfeed.tech/tags/networking.md>), [persistence](<https://devfeed.tech/tags/persistence.md>), [workshops](<https://devfeed.tech/tags/workshops.md>)

### AI overview

The author announces leaving MartianCraft and says they are available for short- and potentially long-term contracting, consulting, and workshops. They specialize in iOS and OS X networking and persistence, particularly Core Data.

### Source excerpt

As of August 1, 2015 I am no longer part of MartianCraft. It is time to move on to the next chapter. What is Next? Long term I have some ideas that will take a bit of time to put into place. In the short time I am eager to help as many teams as [...]

## Core Data and Aggregate Fetches In Swift

DevFeed: [Core Data and Aggregate Fetches In Swift](<https://devfeed.tech/articles/core-data-and-aggregate-fetches-in-swift-37506.md>)

Original publisher: [Read original article](<https://www.cimgf.com/2015/06/25/core-data-and-aggregate-fetches-in-swift/>)

Author: Matt Long

Published: 2015-06-25T16:47:07Z

Content type: tutorial

Language: en

Sources: [Cocoa Is My Girlfriend](<https://devfeed.tech/sources/cocoa-is-my-girlfriend.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [SQLite](<https://devfeed.tech/topics/sqlite.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>)

Tags: [core-data](<https://devfeed.tech/tags/core-data.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ios](<https://devfeed.tech/tags/ios.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sqlite](<https://devfeed.tech/tags/sqlite.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This tutorial explains how Core Data aggregate fetches work in Swift by relating them to SQL-style data grouping and aggregation. It discusses NSExpression and NSExpressionDescription, differences between Core Data and databases, and related batch update and delete capabilities.

### Source excerpt

You can find other articles on the interwebs about NSExpression and NSExpressionDescription, however, I wasn't really satisfied with the explanations I've seen. I decided to write a post myself after I recently had to become much more intimate with the way Core Data aggregate fetches work. I hope this will make clear what has to [...]

## Protocols in Swift With Core Data

DevFeed: [Protocols in Swift With Core Data](<https://devfeed.tech/articles/protocols-in-swift-with-core-data-37500.md>)

Original publisher: [Read original article](<https://www.cimgf.com/2014/10/29/protocols-in-swift-with-core-data/>)

Author: Matt Long

Published: 2014-10-29T16:52:07Z

Content type: tutorial

Language: en

Sources: [Cocoa Is My Girlfriend](<https://devfeed.tech/sources/cocoa-is-my-girlfriend.md>)

Topics: [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [classes](<https://devfeed.tech/topics/classes.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [classes](<https://devfeed.tech/tags/classes.md>), [code](<https://devfeed.tech/tags/code.md>), [core-data](<https://devfeed.tech/tags/core-data.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [intermediate](<https://devfeed.tech/tags/intermediate.md>), [protocols](<https://devfeed.tech/tags/protocols.md>), [swift](<https://devfeed.tech/tags/swift.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

A screencast demonstrates how to use Swift protocols with Core Data to display different managed object types generically in a table view controller.

### Source excerpt

Sometimes you have a set of objects you want to display in the same form-say, for example, in a table view controller. What if those objects have, by design, nothing in common and nothing to do with each other? This is a case where you can create and conform to a protocol-known in some languages [...]

## The Core Data stack in Swift

DevFeed: [The Core Data stack in Swift](<https://devfeed.tech/articles/the-core-data-stack-in-swift-37499.md>)

Original publisher: [Read original article](<https://www.cimgf.com/2014/06/08/the-core-data-stack-in-swift/>)

Author: Marcus Zarra

Published: 2014-06-08T20:47:22Z

Content type: tutorial

Language: en

Sources: [Cocoa Is My Girlfriend](<https://devfeed.tech/sources/cocoa-is-my-girlfriend.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [Code](<https://devfeed.tech/topics/code.md>), [App](<https://devfeed.tech/topics/app.md>)

Tags: [apple](<https://devfeed.tech/tags/apple.md>), [application](<https://devfeed.tech/tags/application.md>), [code](<https://devfeed.tech/tags/code.md>), [core-data](<https://devfeed.tech/tags/core-data.md>), [post](<https://devfeed.tech/tags/post.md>), [swift](<https://devfeed.tech/tags/swift.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

A developer presents a Swift implementation of the Core Data stack, focusing on simplifying save logic, reducing unnecessary variables, and using a lazily loaded variable for initialization.

### Source excerpt

Whenever Apple releases a new version of Xcode one of the first things that I do is look at the default templates and see if there are any new or interesting things. This year, with the release of Swift, there are some pretty radical changes. Yet the Core Data stack initialization code is still the [...]

## Deleting Objects in Core Data

DevFeed: [Deleting Objects in Core Data](<https://devfeed.tech/articles/deleting-objects-in-core-data-37498.md>)

Original publisher: [Read original article](<https://www.cimgf.com/2014/02/25/deleting-objects-in-core-data/>)

Author: Marcus Zarra

Published: 2014-02-25T21:11:07Z

Content type: opinion

Language: en

Sources: [Cocoa Is My Girlfriend](<https://devfeed.tech/sources/cocoa-is-my-girlfriend.md>)

Topics: [iOS](<https://devfeed.tech/topics/ios.md>), [Framework](<https://devfeed.tech/topics/framework.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [notifications](<https://devfeed.tech/topics/notifications.md>)

Tags: [core-data](<https://devfeed.tech/tags/core-data.md>), [crash](<https://devfeed.tech/tags/crash.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [framework](<https://devfeed.tech/tags/framework.md>), [ios](<https://devfeed.tech/tags/ios.md>), [know](<https://devfeed.tech/tags/know.md>), [notifications](<https://devfeed.tech/tags/notifications.md>), [rants](<https://devfeed.tech/tags/rants.md>)

### AI overview

The article argues against avoiding deletion of Core Data managed objects or restricting deletion to application startup. It recommends planning for deletion, using Core Data's built-in change notifications or a custom observer, and avoiding access to objects after they have been deleted because behavior differs across iOS versions and can cause exceptions or crashes.

### Source excerpt

I very rarely speak out against another blog post. I find the resulting argument back and forth draining. However, there are exceptions and one occurred over the weekend. Brent Simmons has been blogging about his conversion of Vesper to a Core Data application. A recent post of his titled Core Data and Deleting Objects set [...]

## Using Core Data Fetched Properties Across Separate Persistent Stores

DevFeed: [Using Core Data Fetched Properties Across Separate Persistent Stores](<https://devfeed.tech/articles/fetched-properties-useful-37497.md>)

Original publisher: [Read original article](<https://www.cimgf.com/2014/01/01/fetched-properties-useful/>)

Author: Marcus Zarra

Published: 2014-01-01T22:32:42Z

Content type: tutorial

Language: en

Sources: [Cocoa Is My Girlfriend](<https://devfeed.tech/sources/cocoa-is-my-girlfriend.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>)

Tags: [core-data](<https://devfeed.tech/tags/core-data.md>), [properties](<https://devfeed.tech/tags/properties.md>), [uncategorized](<https://devfeed.tech/tags/uncategorized.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial explains a Core Data use case for fetched properties: retrieving related metadata from a separate persistent store when relationships cannot span physically separate stores. It also describes how fetched properties are configured and notes that sorting them requires code because the Xcode editor does not provide sort criteria.

### Source excerpt

Core Data has a number of features and abilities that are not commonly used. Chief among those are fetched properties. In discussing them with a number of developers, most have never heard of them and those who have heard of them couldn't come up with a viable use case for them. To be honest, I [...]